mirror of
https://github.com/google/comprehensive-rust.git
synced 2024-12-15 06:20:32 +02:00
Use Arc::clone
instead of .clone()
(#1023)
The fully qualified syntax is recommended for `Arc` which implements all methods as associated methods.
This commit is contained in:
parent
a2367b4d93
commit
e8ea741cea
@ -62,8 +62,8 @@ fn main() {
|
||||
|
||||
for i in 0..forks.len() {
|
||||
let tx = tx.clone();
|
||||
let mut left_fork = forks[i].clone();
|
||||
let mut right_fork = forks[(i + 1) % forks.len()].clone();
|
||||
let mut left_fork = Arc::clone(&forks[i]);
|
||||
let mut right_fork = Arc::clone(&forks[(i + 1) % forks.len()]);
|
||||
|
||||
// To avoid a deadlock, we have to break the symmetry
|
||||
// somewhere. This will swap the forks without deinitializing
|
||||
|
Loading…
Reference in New Issue
Block a user