From 6450eee2ce861f24542877b6a7f0308b1bc4a52a Mon Sep 17 00:00:00 2001 From: ak4ra <45451374+ak4ra@users.noreply.github.com> Date: Fri, 4 Sep 2020 15:59:37 +0300 Subject: [PATCH] Clone.md comment and variable name change If I understand this correctly, moved_pair is not a copy, as Pair does not implement Copy, it is a move. Perhaps 'copy' is used in the comment and name because of the similar example in lines 22-23 above, where there is an actual copy. --- src/trait/clone.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/trait/clone.md b/src/trait/clone.md index 1b9d953b71..5d6747a47b 100644 --- a/src/trait/clone.md +++ b/src/trait/clone.md @@ -30,9 +30,9 @@ fn main() { let pair = Pair(Box::new(1), Box::new(2)); println!("original: {:?}", pair); - // Copy `pair` into `moved_pair`, moves resources + // Move `pair` into `moved_pair`, moves resources let moved_pair = pair; - println!("copy: {:?}", moved_pair); + println!("moved: {:?}", moved_pair); // Error! `pair` has lost its resources //println!("original: {:?}", pair);