docs(users/profpatsch/blog): rust string conversions: &str -> &OsStr
Change-Id: I215cd311551d54ce42c71d4e80ea18f9a17d4cf8 Reviewed-on: https://cl.tvl.fyi/c/depot/+/3879 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de>
This commit is contained in:
parent
1ef8a6c153
commit
70d01b201f
1 changed files with 1 additions and 0 deletions
|
@ -14,6 +14,7 @@ From To Use Comment
|
|||
&str -> String String::from(st)
|
||||
&str -> &[u8] st.as_bytes()
|
||||
&str -> Vec<u8> st.as_bytes().to_owned() via &[u8]
|
||||
&str -> &OsStr OsStr::new(st)
|
||||
|
||||
String -> &str &s alt. s.as_str()
|
||||
String -> &[u8] s.as_bytes()
|
||||
|
|
Loading…
Reference in a new issue