无法导入StrBuf?

时间:2014-04-29 13:44:41

标签: import rust

我无法导入StrBuf

这是一个演示我的问题的示例程序:

use std::strbuf::StrBuf;
fn main() {}

rustc test.rs 给了我以下错误:

test.rs:1:5: 1:16 error: unresolved import: there is no `strbuf` in `std`
test.rs:1 use std::strbuf;
              ^~~~~~~~~~~
test.rs:1:5: 1:16 error: failed to resolve import `std::strbuf`
test.rs:1 use std::strbuf;
              ^~~~~~~~~~~
error: aborting due to 2 previous errors

发生了什么事?

(我使用的是版本0.10,至少根据rustc --version。)

1 个答案:

答案 0 :(得分:0)

从版本0.10开始,Rust似乎没有StrBuf。您可能希望每晚更新到最新版本以使用StrBuf

否则使用~str。它应该有StrBuf的大多数方法。