相关疑难解决方法(0)

收集到 rust 中拥有的字符串的拥有 vec

我正在尝试使用以下方法将 Rust 中的字符串收集到一个 vec 中:

let fields : ~[~str] = row.split_str(",").collect();
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:预期 std::iter::FromIterator<&str>, but found std::iter::FromIterator<~str> (str storage differents: expected &but found ~)

我尝试使用类型提示但没有成功

rust rust-obsolete

3
推荐指数
1
解决办法
3010
查看次数

标签 统计

rust ×1

rust-obsolete ×1