chore(sparv-extension): bump sparv-extension to 0.2.0 #7
check.yml
on: push
Matrix: clippy
Matrix: msrv
stable / fmt
14s
nightly / doc
50s
ubuntu / stable / features
1m 19s
check-check
2s
Annotations
20 warnings
constants have by default a `'static` lifetime:
crates/swegov-opendata/src/lib.rs#L1
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
|
this `impl` can be derived:
crates/swegov-opendata/src/lib.rs#L281
warning: this `impl` can be derived
--> crates/swegov-opendata/src/lib.rs:281:1
|
281 | / impl Default for FilBilaga {
282 | | fn default() -> Self {
283 | | Self { fil: None }
284 | | }
285 | | }
| |_^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls
= note: `#[warn(clippy::derivable_impls)]` on by default
= help: remove the manual implementation...
help: ...and instead derive it
|
276 + #[derive(Default)]
277 | pub struct FilBilaga {
|
|
2 warnings emitted
warning: 2 warnings emitted
|
the borrowed expression implements the required traits:
crates/sparv-extension/src/lib.rs#L65
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
|
called `map(..).flatten()` on `Option`:
crates/sparv-extension/src/lib.rs#L67
warning: called `map(..).flatten()` on `Option`
--> crates/sparv-extension/src/xml_source_writer.rs:67:14
|
67 | .map(|s| s.to_str())
| ______________^
68 | | .flatten()
| |______________________^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|s| s.to_str())`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten
= note: `#[warn(clippy::map_flatten)]` on by default
|
2 warnings emitted
warning: 2 warnings emitted
|
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`:
crates/swegov-opendata-preprocess/src/lib.rs#L43
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
--> crates/swegov-opendata-preprocess/src/nodeinfo/rcdom.rs:43:9
|
43 | / match &child.data {
44 | | NodeData::Text { contents } => {
45 | | if !text_contents.is_empty() {
46 | | text_contents.push_str(separator);
... |
50 | | _ => (),
51 | | }
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
= note: `#[warn(clippy::single_match)]` on by default
help: try
|
43 ~ if let NodeData::Text { contents } = &child.data {
44 + if !text_contents.is_empty() {
45 + text_contents.push_str(separator);
46 + }
47 + text_contents.push_str(contents.borrow().as_ref());
48 + }
|
|
redundant closure:
crates/swegov-opendata-preprocess/src/lib.rs#L71
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
|
using a reference to `Cow` is not recommended:
crates/swegov-opendata-preprocess/src/lib.rs#L13
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
|
this expression creates a reference which is immediately dereferenced by the compiler:
crates/swegov-opendata-preprocess/src/lib.rs#L15
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
|
constants have by default a `'static` lifetime:
crates/swegov-opendata/src/lib.rs#L1
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
|
this `impl` can be derived:
crates/swegov-opendata/src/lib.rs#L281
warning: this `impl` can be derived
--> crates/swegov-opendata/src/lib.rs:281:1
|
281 | / impl Default for FilBilaga {
282 | | fn default() -> Self {
283 | | Self { fil: None }
284 | | }
285 | | }
| |_^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls
= note: `#[warn(clippy::derivable_impls)]` on by default
= help: remove the manual implementation...
help: ...and instead derive it
|
276 + #[derive(Default)]
277 | pub struct FilBilaga {
|
|
2 warnings emitted
warning: 2 warnings emitted
|
the borrowed expression implements the required traits:
crates/sparv-extension/src/lib.rs#L65
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
|
called `map(..).flatten()` on `Option`:
crates/sparv-extension/src/lib.rs#L67
warning: called `map(..).flatten()` on `Option`
--> crates/sparv-extension/src/xml_source_writer.rs:67:14
|
67 | .map(|s| s.to_str())
| ______________^
68 | | .flatten()
| |______________________^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|s| s.to_str())`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten
= note: `#[warn(clippy::map_flatten)]` on by default
|
2 warnings emitted
warning: 2 warnings emitted
|
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`:
crates/swegov-opendata-preprocess/src/lib.rs#L43
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
--> crates/swegov-opendata-preprocess/src/nodeinfo/rcdom.rs:43:9
|
43 | / match &child.data {
44 | | NodeData::Text { contents } => {
45 | | if !text_contents.is_empty() {
46 | | text_contents.push_str(separator);
... |
50 | | _ => (),
51 | | }
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
= note: `#[warn(clippy::single_match)]` on by default
help: try
|
43 ~ if let NodeData::Text { contents } = &child.data {
44 + if !text_contents.is_empty() {
45 + text_contents.push_str(separator);
46 + }
47 + text_contents.push_str(contents.borrow().as_ref());
48 + }
|
|
redundant closure:
crates/swegov-opendata-preprocess/src/lib.rs#L71
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
|
using a reference to `Cow` is not recommended:
crates/swegov-opendata-preprocess/src/lib.rs#L13
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
|
this expression creates a reference which is immediately dereferenced by the compiler:
crates/swegov-opendata-preprocess/src/lib.rs#L15
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
|