about summary refs log tree commit diff
path: root/library/std/src
diff options
context:
space:
mode:
authorKornel <kornel@geekhood.net>2024-11-30 20:32:00 +0000
committerKornel <kornel@geekhood.net>2024-12-02 18:16:36 +0000
commiteadea7764ee49e11165ed041e529cbe79707a31c (patch)
tree9e7727f211eb7676cd1961df8a58a28aa565e10b /library/std/src
parent3bff51ea912d4dfd9caa1e3bc6f68352618208a7 (diff)
Use c"lit" for CStrings without unwrap
Diffstat (limited to 'library/std/src')
-rw-r--r--library/std/src/sys/pal/unix/process/process_common.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/std/src/sys/pal/unix/process/process_common.rs b/library/std/src/sys/pal/unix/process/process_common.rs
index 13290fed762..342818ac911 100644
--- a/library/std/src/sys/pal/unix/process/process_common.rs
+++ b/library/std/src/sys/pal/unix/process/process_common.rs
@@ -393,7 +393,7 @@ impl Command {
 fn os2c(s: &OsStr, saw_nul: &mut bool) -> CString {
     CString::new(s.as_bytes()).unwrap_or_else(|_e| {
         *saw_nul = true;
-        CString::new("<string-with-nul>").unwrap()
+        c"<string-with-nul>".to_owned()
     })
 }