diff --git a/exercises/standard_library_types/arc1.rs b/exercises/standard_library_types/arc1.rs index 07932c6..180d85a 100644 --- a/exercises/standard_library_types/arc1.rs +++ b/exercises/standard_library_types/arc1.rs @@ -4,18 +4,17 @@ // somewhere. Try not to create any copies of the `numbers` Vec! // Execute `rustlings hint arc1` for hints :) -// I AM NOT DONE - #![forbid(unused_imports)] // Do not change this, (or the next) line. use std::sync::Arc; use std::thread; fn main() { let numbers: Vec<_> = (0..100u32).collect(); - let shared_numbers = // TODO + let shared_numbers = Arc::new(numbers); let mut joinhandles = Vec::new(); for offset in 0..8 { + let child_numbers = Arc::clone(&shared_numbers); joinhandles.push(thread::spawn(move || { let mut i = offset; let mut sum = 0;