rust中String,&str,Vec <u8>和&[u8]的惯用转换
转载自:https://zhuanlan.zhihu.com/p/372082802作者:爬一手好线杆&str -> String--| String::from(s) or s.to_string() or s.to_owned()&str -> &[u8]---| s.as_bytes()&str -> Vec<u8>-| s.as_bytes().to_vec() or s.as_bytes().to_ow.
转载
2021-08-27 10:47:29 ·
6039 阅读 ·
0 评论