Prefix it with an underscore: `_i`

pull/1232/head
asthetik 1 year ago
parent e4c6bd7634
commit da44cafd54

@ -148,7 +148,7 @@ println!("{:#?}", array);
**正确的写法**,应该调用`std::array::from_fn` **正确的写法**,应该调用`std::array::from_fn`
```rust ```rust
let array: [String; 8] = std::array::from_fn(|i| String::from("rust is good!")); let array: [String; 8] = std::array::from_fn(|_i| String::from("rust is good!"));
println!("{:#?}", array); println!("{:#?}", array);
``` ```

Loading…
Cancel
Save