Skip to content

chore(sparv-extension): bump sparv-extension to 0.2.0 #10

chore(sparv-extension): bump sparv-extension to 0.2.0

chore(sparv-extension): bump sparv-extension to 0.2.0 #10

GitHub Actions / Clippy: Rust Stable 1.81.0 (eeb90cda1 2024-09-04) in succeeded Sep 23, 2024 in 46s

Clippy (Stable ~ Linux/x86_64)

Clippy was successful!

Details

Running cargo clippy took roughly ~45963ms to complete

  • Working Directory: repository directory

Annotations

Check warning on line 1 in /home/runner/work/swegov-opendata-rs/swegov-opendata-rs/crates/swegov-opendata/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy: Rust Stable 1.81.0 (eeb90cda1 2024-09-04) 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

Check warning on line 65 in /home/runner/work/swegov-opendata-rs/swegov-opendata-rs/crates/sparv-extension/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy: Rust Stable 1.81.0 (eeb90cda1 2024-09-04) 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

Check warning on line 71 in /home/runner/work/swegov-opendata-rs/swegov-opendata-rs/crates/swegov-opendata-preprocess/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy: Rust Stable 1.81.0 (eeb90cda1 2024-09-04) 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

Check warning on line 13 in /home/runner/work/swegov-opendata-rs/swegov-opendata-rs/crates/swegov-opendata-preprocess/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy: Rust Stable 1.81.0 (eeb90cda1 2024-09-04) 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

Check warning on line 15 in /home/runner/work/swegov-opendata-rs/swegov-opendata-rs/crates/swegov-opendata-preprocess/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy: Rust Stable 1.81.0 (eeb90cda1 2024-09-04) 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

Check warning on line 88 in /home/runner/work/swegov-opendata-rs/swegov-opendata-rs/crates/swegov-opendata-preprocess/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy: Rust Stable 1.81.0 (eeb90cda1 2024-09-04) 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

Check warning on line 114 in /home/runner/work/swegov-opendata-rs/swegov-opendata-rs/crates/swegov-opendata-preprocess/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy: Rust Stable 1.81.0 (eeb90cda1 2024-09-04) 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

Check warning on line 128 in /home/runner/work/swegov-opendata-rs/swegov-opendata-rs/crates/swegov-opendata-preprocess/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy: Rust Stable 1.81.0 (eeb90cda1 2024-09-04) 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

Check warning on line 277 in /home/runner/work/swegov-opendata-rs/swegov-opendata-rs/crates/swegov-opendata-preprocess/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy: Rust Stable 1.81.0 (eeb90cda1 2024-09-04) 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

Check warning on line 134 in /home/runner/work/swegov-opendata-rs/swegov-opendata-rs/crates/swegov-opendata-preprocess/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy: Rust Stable 1.81.0 (eeb90cda1 2024-09-04) 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

Check warning on line 175 in /home/runner/work/swegov-opendata-rs/swegov-opendata-rs/crates/swegov-opendata-preprocess/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy: Rust Stable 1.81.0 (eeb90cda1 2024-09-04) 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

Check warning on line 45 in /home/runner/work/swegov-opendata-rs/swegov-opendata-rs/crates/swegov-opendata-preprocess/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy: Rust Stable 1.81.0 (eeb90cda1 2024-09-04) 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 {
   |

Check warning on line 203 in /home/runner/work/swegov-opendata-rs/swegov-opendata-rs/crates/swegov-opendata-preprocess/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy: Rust Stable 1.81.0 (eeb90cda1 2024-09-04) 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 {
    |

Check warning on line 145 in /home/runner/work/swegov-opendata-rs/swegov-opendata-rs/crates/swegov-opendata-preprocess/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy: Rust Stable 1.81.0 (eeb90cda1 2024-09-04) 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

Check warning on line 14 in /home/runner/work/swegov-opendata-rs/swegov-opendata-rs/crates/swegov-opendata-preprocess/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy: Rust Stable 1.81.0 (eeb90cda1 2024-09-04) 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
   |