Merge pull request #1232 from asthetik/fix-warning

Prefix it with an underscore: `_i`
pull/1250/head
Sunface 1 year ago committed by GitHub
commit 8105fae317
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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