Skip to content

Commit

Permalink
Update src/liballoc/boxed.rs
Browse files Browse the repository at this point in the history
Co-Authored-By: Ralf Jung <post@ralfj.de>
  • Loading branch information
matklad and RalfJung committed May 27, 2019
1 parent 0653e78 commit fe31ad3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/liballoc/boxed.rs
Expand Up @@ -395,6 +395,7 @@ impl<T: Clone> Clone for Box<T> {
#[stable(feature = "box_slice_clone", since = "1.3.0")]
impl Clone for Box<str> {
fn clone(&self) -> Self {
// this makes a copy of the data
let buf: Box<[u8]> = self.as_bytes().into();
unsafe {
from_boxed_utf8_unchecked(buf)
Expand Down

0 comments on commit fe31ad3

Please sign in to comment.