diff options
Diffstat (limited to 'src/liballoc/str.rs')
| -rw-r--r-- | src/liballoc/str.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/liballoc/str.rs b/src/liballoc/str.rs index 40104554fe5..70a93157c9e 100644 --- a/src/liballoc/str.rs +++ b/src/liballoc/str.rs @@ -203,7 +203,7 @@ impl ToOwned for str { } fn clone_into(&self, target: &mut String) { - let mut b = mem::replace(target, String::new()).into_bytes(); + let mut b = mem::take(target).into_bytes(); self.as_bytes().clone_into(&mut b); *target = unsafe { String::from_utf8_unchecked(b) } } |
