kuchiki-rs / kuchiki

(朽木) HTML/XML tree manipulation library for Rust
MIT License
470 stars 54 forks source link

Fix clippy warnings #75

Closed jyn514 closed 4 years ago

jyn514 commented 4 years ago
Previous warnings ``` warning: redundant field names in struct initialization --> src/select.rs:370:13 | 370 | iter: iter, | ^^^^^^^^^^ help: replace it with: `iter` | = note: `#[warn(clippy::redundant_field_names)]` on by default = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names warning: redundant field names in struct initialization --> src/tree.rs:205:13 | 205 | data: data, | ^^^^^^^^^^ help: replace it with: `data` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names warning: redundant field names in struct initialization --> src/tree.rs:221:13 | 221 | name: name, | ^^^^^^^^^^ help: replace it with: `name` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names warning: Statics have by default a `'static` lifetime --> src/select.rs:20:30 | 20 | static SELECTOR_WHITESPACE: &'static [char] = &[' ', '\t', '\n', '\r', '\x0C']; | -^^^^^^^------- help: consider removing `'static`: `&[char]` | = note: `#[warn(clippy::redundant_static_lifetimes)]` on by default = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes error: using `clone` on a double-reference; this will copy the reference instead of cloning the inner type --> src/select.rs:292:41 | 292 | .get(&ExpandedName::new(ns_url.clone(), local_name.clone())) | ^^^^^^^^^^^^^^ | = note: `#[deny(clippy::clone_double_ref)]` on by default = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_double_ref help: try dereferencing it | 292 | .get(&ExpandedName::new(&(*ns_url).clone(), local_name.clone())) | ^^^^^^^^^^^^^^^^^^ help: or try being explicit about what type to clone | 292 | .get(&ExpandedName::new(&string_cache::atom::Atom::clone(ns_url), local_name.clone())) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error; 4 warnings emitted ```