chore(sparv-extension): bump sparv-extension to 0.2.0 #10
Clippy (Stable ~ Linux/x86_64)
Clippy was successful!
Details
Running cargo clippy
took roughly ~43750ms to complete
- Working Directory: repository directory
Annotations
github-actions / Clippy: Rust Stable 1.82.0-beta.4 (8c27a2ba6 2024-09-21) in
/home/runner/work/swegov-opendata-rs/swegov-opendata-rs/crates/swegov-opendata/src/lib.rs#L1
constants have by default a `'static` lifetime
Raw output
warning: constants have by default a `'static` lifetime
--> crates/swegov-opendata/src/date_formats.rs:1:16
|
1 | const FORMAT: &'static str = "%Y-%m-%d %H:%M:%S";
| -^^^^^^^---- help: consider removing `'static`: `&str`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes
= note: `#[warn(clippy::redundant_static_lifetimes)]` on by default
github-actions / Clippy: Rust Stable 1.82.0-beta.4 (8c27a2ba6 2024-09-21) in
/home/runner/work/swegov-opendata-rs/swegov-opendata-rs/crates/sparv-extension/src/lib.rs#L65
the borrowed expression implements the required traits
Raw output
warning: the borrowed expression implements the required traits
--> crates/sparv-extension/src/sparv_config.rs:65:24
|
65 | fs::create_dir_all(&path).map_err(|source| SparvError::CouldNotCreateFolder {
| ^^^^^ help: change this to: `path`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
= note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default
github-actions / Clippy: Rust Stable 1.82.0-beta.4 (8c27a2ba6 2024-09-21) in
/home/runner/work/swegov-opendata-rs/swegov-opendata-rs/crates/swegov-opendata-preprocess/src/lib.rs#L71
redundant closure
Raw output
warning: redundant closure
--> crates/swegov-opendata-preprocess/src/nodeinfo/rcdom.rs:71:22
|
71 | .map(|node| rcdom_text_len(node))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `rcdom_text_len`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
= note: `#[warn(clippy::redundant_closure)]` on by default
github-actions / Clippy: Rust Stable 1.82.0-beta.4 (8c27a2ba6 2024-09-21) in
/home/runner/work/swegov-opendata-rs/swegov-opendata-rs/crates/swegov-opendata-preprocess/src/lib.rs#L13
using a reference to `Cow` is not recommended
Raw output
warning: using a reference to `Cow` is not recommended
--> crates/swegov-opendata-preprocess/src/preprocess_rd/html.rs:13:67
|
13 | pub fn process_html(elem: &str, textelem: &mut Element, filename: &Cow<'_, str>) {
| ^^^^^^^^^^^^^ help: change this to: `&str`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
= note: `#[warn(clippy::ptr_arg)]` on by default
github-actions / Clippy: Rust Stable 1.82.0-beta.4 (8c27a2ba6 2024-09-21) in
/home/runner/work/swegov-opendata-rs/swegov-opendata-rs/crates/swegov-opendata-preprocess/src/lib.rs#L15
this expression creates a reference which is immediately dereferenced by the compiler
Raw output
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> crates/swegov-opendata-preprocess/src/preprocess_rd/html.rs:15:33
|
15 | let contentsxml = Soup::new(&elem);
| ^^^^^ help: change this to: `elem`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
github-actions / Clippy: Rust Stable 1.82.0-beta.4 (8c27a2ba6 2024-09-21) in
/home/runner/work/swegov-opendata-rs/swegov-opendata-rs/crates/swegov-opendata-preprocess/src/lib.rs#L88
this expression creates a reference which is immediately dereferenced by the compiler
Raw output
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> crates/swegov-opendata-preprocess/src/preprocess_rd/html.rs:88:38
|
88 | .map(|node| minidom_text_len(&node))
| ^^^^^ help: change this to: `node`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
github-actions / Clippy: Rust Stable 1.82.0-beta.4 (8c27a2ba6 2024-09-21) in
/home/runner/work/swegov-opendata-rs/swegov-opendata-rs/crates/swegov-opendata-preprocess/src/lib.rs#L114
this expression creates a reference which is immediately dereferenced by the compiler
Raw output
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> crates/swegov-opendata-preprocess/src/preprocess_rd/html.rs:114:25
|
114 | dbg!(dbg_rcdom_node(&node));
| ^^^^^ help: change this to: `node`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
github-actions / Clippy: Rust Stable 1.82.0-beta.4 (8c27a2ba6 2024-09-21) in
/home/runner/work/swegov-opendata-rs/swegov-opendata-rs/crates/swegov-opendata-preprocess/src/lib.rs#L128
this expression creates a reference which is immediately dereferenced by the compiler
Raw output
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> crates/swegov-opendata-preprocess/src/preprocess_rd/html.rs:128:47
|
128 | println!("{}", dbg_rcdom_node(&node));
| ^^^^^ help: change this to: `node`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
github-actions / Clippy: Rust Stable 1.82.0-beta.4 (8c27a2ba6 2024-09-21) in
/home/runner/work/swegov-opendata-rs/swegov-opendata-rs/crates/swegov-opendata-preprocess/src/lib.rs#L277
this expression creates a reference which is immediately dereferenced by the compiler
Raw output
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> crates/swegov-opendata-preprocess/src/preprocess_rd/html.rs:277:64
|
277 | println!("extract_metadata_value: node={}", dbg_rcdom_node(&node));
| ^^^^^ help: change this to: `node`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
github-actions / Clippy: Rust Stable 1.82.0-beta.4 (8c27a2ba6 2024-09-21) in
/home/runner/work/swegov-opendata-rs/swegov-opendata-rs/crates/swegov-opendata-preprocess/src/lib.rs#L134
the borrowed expression implements the required traits
Raw output
warning: the borrowed expression implements the required traits
--> crates/swegov-opendata-preprocess/src/preprocess_rd/rd_corpura.rs:134:19
|
134 | .join(&corpus_source_base);
| ^^^^^^^^^^^^^^^^^^^ help: change this to: `corpus_source_base`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
= note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default
github-actions / Clippy: Rust Stable 1.82.0-beta.4 (8c27a2ba6 2024-09-21) in
/home/runner/work/swegov-opendata-rs/swegov-opendata-rs/crates/swegov-opendata-preprocess/src/lib.rs#L175
the borrowed expression implements the required traits
Raw output
warning: the borrowed expression implements the required traits
--> crates/swegov-opendata-preprocess/src/preprocess_rd/rd_corpura.rs:175:35
|
175 | let zip_file = fs::File::open(&zippath)
| ^^^^^^^^ help: change this to: `zippath`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
github-actions / Clippy: Rust Stable 1.82.0-beta.4 (8c27a2ba6 2024-09-21) in
/home/runner/work/swegov-opendata-rs/swegov-opendata-rs/crates/swegov-opendata-preprocess/src/lib.rs#L45
this pattern creates a reference to a reference
Raw output
warning: this pattern creates a reference to a reference
--> crates/swegov-opendata-preprocess/src/preprocess_sfs/sfs_json/sfs_div_dok.rs:45:47
|
45 | if let ParseHtmlState::Skip { ref tag } = state {
| ^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
help: try
|
45 ~ if let ParseHtmlState::Skip { tag } = state {
46 ~ if e.name().as_ref() == tag {
|
github-actions / Clippy: Rust Stable 1.82.0-beta.4 (8c27a2ba6 2024-09-21) in
/home/runner/work/swegov-opendata-rs/swegov-opendata-rs/crates/swegov-opendata-preprocess/src/lib.rs#L203
this pattern creates a reference to a reference
Raw output
warning: this pattern creates a reference to a reference
--> crates/swegov-opendata-preprocess/src/preprocess_sfs/sfs_json/sfs_div_dok.rs:203:49
|
203 | if let ExtractPageState::Skip { ref tag } = state {
| ^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
help: try
|
203 ~ if let ExtractPageState::Skip { tag } = state {
204 ~ if e.name().as_ref() == tag {
|
github-actions / Clippy: Rust Stable 1.82.0-beta.4 (8c27a2ba6 2024-09-21) in
/home/runner/work/swegov-opendata-rs/swegov-opendata-rs/crates/swegov-opendata-preprocess/src/lib.rs#L145
replacing text with itself
Raw output
warning: replacing text with itself
--> crates/swegov-opendata-preprocess/src/preprocess_sfs/sfs_json.rs:145:30
|
145 | let contents_processed = contents.replace('\"', r#"""#);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect_replace
= note: `#[warn(clippy::no_effect_replace)]` on by default
github-actions / Clippy: Rust Stable 1.82.0-beta.4 (8c27a2ba6 2024-09-21) in
/home/runner/work/swegov-opendata-rs/swegov-opendata-rs/crates/swegov-opendata-preprocess/src/lib.rs#L14
unneeded `return` statement
Raw output
warning: unneeded `return` statement
--> crates/swegov-opendata-preprocess/src/preprocess_sfs/shared.rs:14:5
|
14 | return false;
| ^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
= note: `#[warn(clippy::needless_return)]` on by default
help: remove `return`
|
14 - return false;
14 + false
|