Skip to content

Commit 6450eee

Browse files
authored
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.
1 parent 19f0a03 commit 6450eee

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/trait/clone.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ fn main() {
3030
let pair = Pair(Box::new(1), Box::new(2));
3131
println!("original: {:?}", pair);
3232
33-
// Copy `pair` into `moved_pair`, moves resources
33+
// Move `pair` into `moved_pair`, moves resources
3434
let moved_pair = pair;
35-
println!("copy: {:?}", moved_pair);
35+
println!("moved: {:?}", moved_pair);
3636
3737
// Error! `pair` has lost its resources
3838
//println!("original: {:?}", pair);

0 commit comments

Comments
 (0)