about summary refs log tree commit diff
path: root/library/alloc/src
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2025-01-08 21:18:46 +0000
committerEsteban Küber <esteban@kuber.com.ar>2025-01-08 21:19:28 +0000
commiteb917ea24deeeb92ab76fcb215aac4c7a567644d (patch)
treea5e75bc8e25bb793fd283e3276c18829ed5c8817 /library/alloc/src
parenta580b5c379b4fca50dfe5afc0fc0ce00921e4e00 (diff)
downloadrust-eb917ea24deeeb92ab76fcb215aac4c7a567644d.tar.gz
rust-eb917ea24deeeb92ab76fcb215aac4c7a567644d.zip
Remove some unnecessary `.into()` calls
Diffstat (limited to 'library/alloc/src')
-rw-r--r--library/alloc/src/rc.rs2
-rw-r--r--library/alloc/src/sync.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/library/alloc/src/rc.rs b/library/alloc/src/rc.rs
index e014404eff3..08a7b325798 100644
--- a/library/alloc/src/rc.rs
+++ b/library/alloc/src/rc.rs
@@ -1789,7 +1789,7 @@ impl<T: ?Sized, A: Allocator> Rc<T, A> {
     /// let x: Rc<&str> = Rc::new("Hello, world!");
     /// {
     ///     let s = String::from("Oh, no!");
-    ///     let mut y: Rc<&str> = x.clone().into();
+    ///     let mut y: Rc<&str> = x.clone();
     ///     unsafe {
     ///         // this is Undefined Behavior, because x's inner type
     ///         // is &'long str, not &'short str
diff --git a/library/alloc/src/sync.rs b/library/alloc/src/sync.rs
index b34a6d3f660..30761739dbf 100644
--- a/library/alloc/src/sync.rs
+++ b/library/alloc/src/sync.rs
@@ -2468,7 +2468,7 @@ impl<T: ?Sized, A: Allocator> Arc<T, A> {
     /// let x: Arc<&str> = Arc::new("Hello, world!");
     /// {
     ///     let s = String::from("Oh, no!");
-    ///     let mut y: Arc<&str> = x.clone().into();
+    ///     let mut y: Arc<&str> = x.clone();
     ///     unsafe {
     ///         // this is Undefined Behavior, because x's inner type
     ///         // is &'long str, not &'short str