Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions library/alloc/src/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3878,7 +3878,7 @@ impl From<&mut str> for Arc<str> {
#[cfg(not(no_global_oom_handling))]
#[stable(feature = "shared_from_slice", since = "1.21.0")]
impl From<String> for Arc<str> {
/// Allocates a reference-counted `str` and copies `v` into it.
/// Converts the given [`String`] to a shared reference-counted `str` slice.
///
/// # Example
///
Expand All @@ -3890,7 +3890,7 @@ impl From<String> for Arc<str> {
/// ```
#[inline]
fn from(v: String) -> Arc<str> {
Arc::from(&v[..])
Arc::from(v.into_boxed_str())
}
}

Expand Down
Loading