【发布时间】:2014-09-02 15:51:08
【问题描述】:
我刚开始学习 Rust,偶然发现了这个愚蠢的问题:
error: mismatched types: expected `&[u8]` but found `&collections::vec::Vec<u8>` (expected vector but found struct collections::vec::Vec)
我的代码如下所示:
let compressed_contents = match File::open(&Path::new(path)).read_to_end() {
Ok(f) => f,
Err(e) => fail!("File error: {}", e),
};
let contents = inflate_bytes(&compressed_contents);
它需要一个向量,我给它一个向量。显然它还需要其他类型的向量?
【问题讨论】:
标签: rust