Skip to content

Commit

Permalink
Merge pull request nrc#120 from markus2330/patch-1
Browse files Browse the repository at this point in the history
changed variable name
  • Loading branch information
nrc committed Jan 12, 2022
2 parents c0f1944 + d556234 commit 42db8c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions borrowed.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ fn foo() {
let mut x = 5;
let xr = &mut x; // Ok (creates a mutable ref)
*xr = 4; // Ok
//let xr = &x; // Error - there is already a mutable ref, so we
//let xr2 = &x; // Error - there is already a mutable ref, so we
// can't make an immutable one
//let xr = &mut x; // Error - can only have one mutable ref at a time
//let xr2 = &mut x; // Error - can only have one mutable ref at a time
bar(xr); // Ok
bar_mut(xr); // Ok
}
Expand Down

0 comments on commit 42db8c1

Please sign in to comment.