mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-15 20:45:45 +03:00
constify (the unstable) str::as_str
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user