about summary refs log tree commit diff
path: root/users/Profpatsch/blog/notes
diff options
context:
space:
mode:
authorProfpatsch <mail@profpatsch.de>2021-11-15T00·13+0100
committerProfpatsch <mail@profpatsch.de>2021-11-15T00·31+0000
commit70d01b201f93a4980fe190de06440ae9525a6b13 (patch)
tree7499262934369efa1fe0e54147fb7718ef14e9d3 /users/Profpatsch/blog/notes
parent1ef8a6c1532d09a0079de2b798f509dcda1dc49a (diff)
docs(users/profpatsch/blog): rust string conversions: &str -> &OsStr r/3067
Change-Id: I215cd311551d54ce42c71d4e80ea18f9a17d4cf8
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3879
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
Diffstat (limited to 'users/Profpatsch/blog/notes')
-rw-r--r--users/Profpatsch/blog/notes/rust-string-conversions.md1
1 files changed, 1 insertions, 0 deletions
diff --git a/users/Profpatsch/blog/notes/rust-string-conversions.md b/users/Profpatsch/blog/notes/rust-string-conversions.md
index ac8c8f892572..99071ef9d370 100644
--- a/users/Profpatsch/blog/notes/rust-string-conversions.md
+++ b/users/Profpatsch/blog/notes/rust-string-conversions.md
@@ -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()