diff options
| author | Matthias Krüger <476013+matthiaskrgr@users.noreply.github.com> | 2025-06-04 07:54:33 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-04 07:54:33 +0200 |
| commit | 88620b400e0dceb982af11f2309516ef088cbffa (patch) | |
| tree | 58069d5ac7b9105d1761564c41b0993482b6fa4a /library/std/src/sys/os_str/bytes.rs | |
| parent | 59bdb5c3cfa4e746cc7e086073a9f5f9d1d87f75 (diff) | |
| parent | fab206bf5852c532f85b9ad30f9eea8fc952e8e1 (diff) | |
| download | rust-88620b400e0dceb982af11f2309516ef088cbffa.tar.gz rust-88620b400e0dceb982af11f2309516ef088cbffa.zip | |
Rollup merge of #141467 - cyrgani:const-empty-stringlikes, r=Amanieu
make `OsString::new` and `PathBuf::new` unstably const Since #129041, `String::into_bytes` is `const`, which allows making `OsString::new` and `PathBuf::new` unstably const now. Not sure what the exact process for this is; does it need an ACP?
Diffstat (limited to 'library/std/src/sys/os_str/bytes.rs')
| -rw-r--r-- | library/std/src/sys/os_str/bytes.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/library/std/src/sys/os_str/bytes.rs b/library/std/src/sys/os_str/bytes.rs index 4a8808c9230..f8ab4543a3a 100644 --- a/library/std/src/sys/os_str/bytes.rs +++ b/library/std/src/sys/os_str/bytes.rs @@ -115,7 +115,7 @@ impl Buf { } #[inline] - pub fn from_string(s: String) -> Buf { + pub const fn from_string(s: String) -> Buf { Buf { inner: s.into_bytes() } } |
