constify (the unstable) str::as_str

This commit is contained in:
Pavel Grigorenko
2025-08-27 16:15:08 +03:00
parent 4f808ba6bf
commit e06cd9f2c8
+1 -1
View File
@@ -3072,7 +3072,7 @@ pub fn substr_range(&self, substr: &str) -> Option<Range<usize>> {
/// 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
}
}