diff options
| author | Pavel Grigorenko <GrigorenkoPV@ya.ru> | 2025-08-27 16:15:08 +0300 |
|---|---|---|
| committer | Pavel Grigorenko <GrigorenkoPV@ya.ru> | 2025-08-27 16:26:24 +0300 |
| commit | e06cd9f2c82c5bb3999eafda7abe2b1951384f78 (patch) | |
| tree | 0385b04e9f996be5e205dae21a0a234b1b62f22c | |
| parent | 4f808ba6bf9f1c8dde30d009e73386d984491587 (diff) | |
| download | rust-e06cd9f2c82c5bb3999eafda7abe2b1951384f78.tar.gz rust-e06cd9f2c82c5bb3999eafda7abe2b1951384f78.zip | |
`const`ify (the unstable) `str::as_str`
| -rw-r--r-- | library/core/src/str/mod.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/library/core/src/str/mod.rs b/library/core/src/str/mod.rs index 1b6e84175b9..1a055a0a5ad 100644 --- a/library/core/src/str/mod.rs +++ b/library/core/src/str/mod.rs @@ -3072,7 +3072,7 @@ impl str { /// for example references to `Box<str>` or `Arc<str>`. #[inline] #[unstable(feature = "str_as_str", issue = "130366")] - pub fn as_str(&self) -> &str { + pub const fn as_str(&self) -> &str { self } } |
