Skip to content

Commit

Permalink
Use force_mut return mut ref in test
Browse files Browse the repository at this point in the history
  • Loading branch information
danielSanchezQ committed Sep 2, 2022
1 parent d3e28a5 commit cca53a4
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions tests/it.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,10 @@ mod unsync {
92
});
assert_eq!(called.get(), 0);
Lazy::force_mut(&mut x);
let mut v = Lazy::force_mut(&mut x);
assert_eq!(called.get(), 1);

let y = *x - 30;
assert_eq!(y, 62);
assert_eq!(called.get(), 1);

*x /= 2;
*v /= 2;
assert_eq!(*x, 46);
assert_eq!(called.get(), 1);
}
Expand Down

0 comments on commit cca53a4

Please sign in to comment.