dmikusa / binding-tool

Generate Kubernetes service bindings for use with Cloud Native Buildpacks
Apache License 2.0
27 stars 4 forks source link

Fix error "consider removing `.into_iter()`" #41

Closed anthonydahanne closed 1 year ago

anthonydahanne commented 1 year ago
Run actions-rs/cargo@v1
/home/runner/.cargo/bin/cargo clippy -- -D warnings
    Checking binding_tool v1.17.0 (/home/runner/work/binding-tool/binding-tool)
error: useless conversion to the same type: `clap::parser::ValuesRef<'_, std::string::String>`
Error:    --> src/command.rs:345:26
    |
345 |         btp.add_bindings(binding_key_vals.unwrap().into_iter().map(|s| s.as_str()))
    |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `binding_key_vals.unwrap()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
    = note: `-D clippy::useless-conversion` implied by `-D warnings`

error: could not compile `binding_tool` due to previous error
Error: The process '/home/runner/.cargo/bin/cargo' failed with exit code 101
dmikusa commented 1 year ago

I fixed this when I was updating the workflows. Thanks for submitting a PR though.