< 返回我的博客

rdigua 发表于 2020-11-15 16:40

Tags:rust

从路径得到字符串

//path: AsRef

let string1 = String::from(path.as_ref().to_str().unwrap_or("The path had some error.")));

//or let s=path.as_ref().display().to_string();

评论区

写评论

还没有评论

1 共 0 条评论, 1 页