From 70d01b201f93a4980fe190de06440ae9525a6b13 Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Mon, 15 Nov 2021 01:13:52 +0100 Subject: 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 --- users/Profpatsch/blog/notes/rust-string-conversions.md | 1 + 1 file changed, 1 insertion(+) 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 st.as_bytes().to_owned() via &[u8] +&str -> &OsStr OsStr::new(st) String -> &str &s alt. s.as_str() String -> &[u8] s.as_bytes() -- cgit 1.4.1