[INFO] fetching crate stam 0.18.6... [INFO] linting stam-0.18.6 against nightly for clippy-nonminimal_bool-denied [INFO] extracting crate stam 0.18.6 into /workspace/builds/worker-2-tc1/source [INFO] started tweaking crates.io crate stam 0.18.6 [INFO] removed 0 missing tests [INFO] finished tweaking crates.io crate stam 0.18.6 [INFO] tweaked toml for crates.io crate stam 0.18.6 written to /workspace/builds/worker-2-tc1/source/Cargo.toml [INFO] validating manifest of crates.io crate stam 0.18.6 on toolchain nightly [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] crate crates.io crate stam 0.18.6 already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Updating crates.io index [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded csv-core v0.1.11 [INFO] [stderr] Downloaded minicbor-derive v0.16.2 [INFO] [stderr] Downloaded minicbor v0.26.5 [INFO] [stderr] Downloaded half v2.3.1 [INFO] [stderr] Downloaded web-sys v0.3.67 [INFO] [stderr] Downloaded datasize v0.2.15 [INFO] [stderr] Downloaded datasize_derive v0.2.15 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] cc133cfa4394385452fad1017a61717ca5ee66d609b00e52d8edc1286adc4ac1 [INFO] running `Command { std: "docker" "start" "-a" "cc133cfa4394385452fad1017a61717ca5ee66d609b00e52d8edc1286adc4ac1", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "cc133cfa4394385452fad1017a61717ca5ee66d609b00e52d8edc1286adc4ac1", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "cc133cfa4394385452fad1017a61717ca5ee66d609b00e52d8edc1286adc4ac1", kill_on_drop: false }` [INFO] [stdout] cc133cfa4394385452fad1017a61717ca5ee66d609b00e52d8edc1286adc4ac1 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 79be79eede0f9a1f02d66eae8e7a0a9c23311691c401f69cc5e0ef362802db64 [INFO] running `Command { std: "docker" "start" "-a" "79be79eede0f9a1f02d66eae8e7a0a9c23311691c401f69cc5e0ef362802db64", kill_on_drop: false }` [INFO] [stderr] Compiling proc-macro2 v1.0.89 [INFO] [stderr] Compiling libc v0.2.152 [INFO] [stderr] Checking memchr v2.7.1 [INFO] [stderr] Compiling crossbeam-utils v0.8.19 [INFO] [stderr] Checking itoa v1.0.10 [INFO] [stderr] Compiling serde_json v1.0.143 [INFO] [stderr] Checking ryu v1.0.16 [INFO] [stderr] Checking either v1.9.0 [INFO] [stderr] Compiling num-traits v0.2.17 [INFO] [stderr] Compiling indexmap v1.9.3 [INFO] [stderr] Checking half v2.3.1 [INFO] [stderr] Compiling generic-array v0.14.7 [INFO] [stderr] Compiling minicbor v0.26.5 [INFO] [stderr] Checking plotters-backend v0.3.5 [INFO] [stderr] Checking smallvec v1.15.1 [INFO] [stderr] Checking textwrap v0.16.0 [INFO] [stderr] Checking ciborium-ll v0.2.2 [INFO] [stderr] Checking cpufeatures v0.2.12 [INFO] [stderr] Checking iana-time-zone v0.1.60 [INFO] [stderr] Checking itertools v0.10.5 [INFO] [stderr] Checking walkdir v2.4.0 [INFO] [stderr] Checking base16ct v0.1.1 [INFO] [stderr] Checking plotters-svg v0.3.5 [INFO] [stderr] Checking oorandom v11.1.3 [INFO] [stderr] Checking crossbeam-epoch v0.9.18 [INFO] [stderr] Checking aho-corasick v1.1.2 [INFO] [stderr] Checking csv-core v0.1.11 [INFO] [stderr] Compiling quote v1.0.35 [INFO] [stderr] Checking clap v3.2.25 [INFO] [stderr] Checking block-buffer v0.10.4 [INFO] [stderr] Checking crypto-common v0.1.6 [INFO] [stderr] Checking getrandom v0.2.12 [INFO] [stderr] Checking atty v0.2.14 [INFO] [stderr] Compiling syn v2.0.87 [INFO] [stderr] Compiling syn v1.0.109 [INFO] [stderr] Checking digest v0.10.7 [INFO] [stderr] Checking crossbeam-deque v0.8.5 [INFO] [stderr] Checking rayon-core v1.13.0 [INFO] [stderr] Checking rand_core v0.6.4 [INFO] [stderr] Checking sha1 v0.10.6 [INFO] [stderr] Checking rand_chacha v0.3.1 [INFO] [stderr] Checking criterion-plot v0.5.0 [INFO] [stderr] Checking rand v0.8.5 [INFO] [stderr] Checking rayon v1.11.0 [INFO] [stderr] Checking plotters v0.3.5 [INFO] [stderr] Checking regex-automata v0.4.9 [INFO] [stderr] Checking nanoid v0.4.0 [INFO] [stderr] Checking regex v1.11.2 [INFO] [stderr] Compiling serde_derive v1.0.219 [INFO] [stderr] Compiling minicbor-derive v0.16.2 [INFO] [stderr] Compiling sealed v0.6.0 [INFO] [stderr] Compiling datasize_derive v0.2.15 [INFO] [stderr] Checking datasize v0.2.15 [INFO] [stderr] Checking serde v1.0.219 [INFO] [stderr] Checking serde_path_to_error v0.1.17 [INFO] [stderr] Checking csv v1.3.1 [INFO] [stderr] Checking ciborium v0.2.2 [INFO] [stderr] Checking chrono v0.4.42 [INFO] [stderr] Checking tinytemplate v1.2.1 [INFO] [stderr] Checking criterion v0.4.0 [INFO] [stderr] Checking stam v0.18.6 (/opt/rustwide/workdir) [INFO] [stdout] warning: empty line after doc comment [INFO] [stdout] --> src/annotationstore.rs:2267:5 [INFO] [stdout] | [INFO] [stdout] 2267 | / /// Find all annotations that overlap with a particular offset. [INFO] [stdout] 2268 | | /* [INFO] [stdout] 2269 | | pub fn annotations_by_offset_operator( [INFO] [stdout] 2270 | | &self, [INFO] [stdout] ... | [INFO] [stdout] 2283 | | */ [INFO] [stdout] 2284 | | [INFO] [stdout] | |_^ [INFO] [stdout] ... [INFO] [stdout] 2289 | pub(crate) fn annotations_by_annotation( [INFO] [stdout] | --------------------------------------- the comment documents this function [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments [INFO] [stdout] = note: `#[warn(clippy::empty_line_after_doc_comments)]` on by default [INFO] [stdout] = help: if the empty line is unintentional, remove it [INFO] [stdout] help: if the doc comment should not document function `annotations_by_annotation` then comment it out [INFO] [stdout] | [INFO] [stdout] 2267 | // /// Find all annotations that overlap with a particular offset. [INFO] [stdout] | ++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty line after doc comment [INFO] [stdout] --> src/api/text.rs:190:5 [INFO] [stdout] | [INFO] [stdout] 190 | / /// If it doesn't exist yet, a new one will be returned, and it won't have a handle, nor will it be added to the store automa... [INFO] [stdout] 191 | | [INFO] [stdout] | |_^ [INFO] [stdout] ... [INFO] [stdout] 195 | fn textselection(&'slf self, offset: &Offset) [INFO] [stdout] | ---------------- the comment documents this function [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments [INFO] [stdout] = help: if the empty line is unintentional, remove it [INFO] [stdout] help: if the documentation should include the empty line include it in the comment [INFO] [stdout] | [INFO] [stdout] 191 | /// [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this import is redundant [INFO] [stdout] --> src/csv.rs:17:1 [INFO] [stdout] | [INFO] [stdout] 17 | use csv; [INFO] [stdout] | ^^^^^^^^ help: remove it entirely [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports [INFO] [stdout] = note: `#[warn(clippy::single_component_path_imports)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this import is redundant [INFO] [stdout] --> src/textvalidation.rs:24:1 [INFO] [stdout] | [INFO] [stdout] 24 | use base16ct; [INFO] [stdout] | ^^^^^^^^^^^^^ help: remove it entirely [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty line after doc comment [INFO] [stdout] --> src/annotationstore.rs:2267:5 [INFO] [stdout] | [INFO] [stdout] 2267 | / /// Find all annotations that overlap with a particular offset. [INFO] [stdout] 2268 | | /* [INFO] [stdout] 2269 | | pub fn annotations_by_offset_operator( [INFO] [stdout] 2270 | | &self, [INFO] [stdout] ... | [INFO] [stdout] 2283 | | */ [INFO] [stdout] 2284 | | [INFO] [stdout] | |_^ [INFO] [stdout] ... [INFO] [stdout] 2289 | pub(crate) fn annotations_by_annotation( [INFO] [stdout] | --------------------------------------- the comment documents this function [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments [INFO] [stdout] = note: `#[warn(clippy::empty_line_after_doc_comments)]` on by default [INFO] [stdout] = help: if the empty line is unintentional, remove it [INFO] [stdout] help: if the doc comment should not document function `annotations_by_annotation` then comment it out [INFO] [stdout] | [INFO] [stdout] 2267 | // /// Find all annotations that overlap with a particular offset. [INFO] [stdout] | ++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty line after doc comment [INFO] [stdout] --> src/api/text.rs:190:5 [INFO] [stdout] | [INFO] [stdout] 190 | / /// If it doesn't exist yet, a new one will be returned, and it won't have a handle, nor will it be added to the store automa... [INFO] [stdout] 191 | | [INFO] [stdout] | |_^ [INFO] [stdout] ... [INFO] [stdout] 195 | fn textselection(&'slf self, offset: &Offset) [INFO] [stdout] | ---------------- the comment documents this function [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments [INFO] [stdout] = help: if the empty line is unintentional, remove it [INFO] [stdout] help: if the documentation should include the empty line include it in the comment [INFO] [stdout] | [INFO] [stdout] 191 | /// [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this import is redundant [INFO] [stdout] --> src/csv.rs:17:1 [INFO] [stdout] | [INFO] [stdout] 17 | use csv; [INFO] [stdout] | ^^^^^^^^ help: remove it entirely [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports [INFO] [stdout] = note: `#[warn(clippy::single_component_path_imports)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this import is redundant [INFO] [stdout] --> src/textvalidation.rs:24:1 [INFO] [stdout] | [INFO] [stdout] 24 | use base16ct; [INFO] [stdout] | ^^^^^^^^^^^^^ help: remove it entirely [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the impl [INFO] [stdout] --> src/annotation.rs:89:6 [INFO] [stdout] | [INFO] [stdout] 89 | impl<'a> Request for AnnotationHandle { [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] = note: `#[warn(clippy::extra_unused_lifetimes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'store [INFO] [stdout] --> src/annotation.rs:90:18 [INFO] [stdout] | [INFO] [stdout] 90 | fn to_handle<'store, S>(&self, _store: &'store S) -> Option [INFO] [stdout] | ^^^^^^ ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: `#[warn(clippy::needless_lifetimes)]` on by default [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 90 - fn to_handle<'store, S>(&self, _store: &'store S) -> Option [INFO] [stdout] 90 + fn to_handle(&self, _store: &S) -> Option [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/annotation.rs:168:9 [INFO] [stdout] | [INFO] [stdout] 168 | return Err(StamError::OtherError("Can not merge annotations")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 168 - return Err(StamError::OtherError("Can not merge annotations")); [INFO] [stdout] 168 + Err(StamError::OtherError("Can not merge annotations")) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/annotation.rs:368:43 [INFO] [stdout] | [INFO] [stdout] 368 | let target = WrappedSelector::new(&self.as_ref().target(), &self.store()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `self.as_ref().target()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/annotation.rs:368:68 [INFO] [stdout] | [INFO] [stdout] 368 | let target = WrappedSelector::new(&self.as_ref().target(), &self.store()); [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `self.store()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/annotation.rs:370:69 [INFO] [stdout] | [INFO] [stdout] 370 | let wrappeddata = AnnotationDataRefSerializer { annotation: &self }; [INFO] [stdout] | ^^^^^ help: change this to: `self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `builder.target` after checking its variant with `is_none` [INFO] [stdout] --> src/annotation.rs:620:36 [INFO] [stdout] | [INFO] [stdout] 617 | let target: Option = if builder.target.is_none() { [INFO] [stdout] | --------------------------- help: try: `if let Some() = builder.target` [INFO] [stdout] ... [INFO] [stdout] 620 | Some(self.selector(builder.target.unwrap()).map_err(|err| { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/annotation.rs:632:40 [INFO] [stdout] | [INFO] [stdout] 632 | annotation.data.extend(data.into_iter()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/91021ccc790478a1a89c003e7d32b8d155ae6aae/library/core/src/iter/traits/collect.rs:416:17 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 632 - annotation.data.extend(data.into_iter()); [INFO] [stdout] 632 + annotation.data.extend(data); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/annotation.rs:658:1 [INFO] [stdout] | [INFO] [stdout] 658 | / impl Default for ReannotateMode { [INFO] [stdout] 659 | | fn default() -> Self { [INFO] [stdout] 660 | | Self::Add [INFO] [stdout] 661 | | } [INFO] [stdout] 662 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 651 + #[derive(Default)] [INFO] [stdout] 652 | pub enum ReannotateMode { [INFO] [stdout] 653 | /// Replaces all existing data with the new data [INFO] [stdout] 654 | Replace, [INFO] [stdout] 655 | /// Adds the new data to the existing data [INFO] [stdout] 656 ~ #[default] [INFO] [stdout] 657 ~ Add, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Annotation` has a public `len` method, but no `is_empty` method [INFO] [stdout] --> src/annotation.rs:710:5 [INFO] [stdout] | [INFO] [stdout] 710 | pub fn len(&self) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_without_is_empty [INFO] [stdout] = note: `#[warn(clippy::len_without_is_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the impl [INFO] [stdout] --> src/annotationdata.rs:74:6 [INFO] [stdout] | [INFO] [stdout] 74 | impl<'a> Request for AnnotationDataHandle { [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'store [INFO] [stdout] --> src/annotationdata.rs:75:18 [INFO] [stdout] | [INFO] [stdout] 75 | fn to_handle<'store, S>(&self, _store: &'store S) -> Option [INFO] [stdout] | ^^^^^^ ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 75 - fn to_handle<'store, S>(&self, _store: &'store S) -> Option [INFO] [stdout] 75 + fn to_handle(&self, _store: &S) -> Option [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Some` variant of the iterator element is used [INFO] [stdout] --> src/annotationdata.rs:214:9 [INFO] [stdout] | [INFO] [stdout] 214 | / for data in self.store.iter() { [INFO] [stdout] 215 | | if let Some(data) = data { [INFO] [stdout] 216 | | seq.serialize_element(&ResultItem::new_partial(data, self.parent))?; [INFO] [stdout] 217 | | } [INFO] [stdout] 218 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/annotationdata.rs:215:13 [INFO] [stdout] | [INFO] [stdout] 215 | / if let Some(data) = data { [INFO] [stdout] 216 | | seq.serialize_element(&ResultItem::new_partial(data, self.parent))?; [INFO] [stdout] 217 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] = note: `#[warn(clippy::manual_flatten)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 214 ~ for data in self.store.iter().flatten() { [INFO] [stdout] 215 + seq.serialize_element(&ResultItem::new_partial(data, self.parent))?; [INFO] [stdout] 216 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the impl [INFO] [stdout] --> src/annotationdataset.rs:105:6 [INFO] [stdout] | [INFO] [stdout] 105 | impl<'a> Request for AnnotationDataSetHandle { [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'store [INFO] [stdout] --> src/annotationdataset.rs:106:18 [INFO] [stdout] | [INFO] [stdout] 106 | fn to_handle<'store, S>(&self, _store: &'store S) -> Option [INFO] [stdout] | ^^^^^^ ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 106 - fn to_handle<'store, S>(&self, _store: &'store S) -> Option [INFO] [stdout] 106 + fn to_handle(&self, _store: &S) -> Option [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the impl [INFO] [stdout] --> src/annotationdataset.rs:113:6 [INFO] [stdout] | [INFO] [stdout] 113 | impl<'a> Request for Option { [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'store [INFO] [stdout] --> src/annotationdataset.rs:114:18 [INFO] [stdout] | [INFO] [stdout] 114 | fn to_handle<'store, S>(&self, _store: &'store S) -> Option [INFO] [stdout] | ^^^^^^ ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 114 - fn to_handle<'store, S>(&self, _store: &'store S) -> Option [INFO] [stdout] 114 + fn to_handle(&self, _store: &S) -> Option [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Some` variant of the iterator element is used [INFO] [stdout] --> src/annotationdataset.rs:179:9 [INFO] [stdout] | [INFO] [stdout] 179 | / for key in other.keys { [INFO] [stdout] 180 | | if let Some(key) = key { [INFO] [stdout] 181 | | self.insert(key.unbind())?; [INFO] [stdout] 182 | | } [INFO] [stdout] 183 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/annotationdataset.rs:180:13 [INFO] [stdout] | [INFO] [stdout] 180 | / if let Some(key) = key { [INFO] [stdout] 181 | | self.insert(key.unbind())?; [INFO] [stdout] 182 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 179 ~ for key in other.keys.into_iter().flatten() { [INFO] [stdout] 180 + self.insert(key.unbind())?; [INFO] [stdout] 181 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Some` variant of the iterator element is used [INFO] [stdout] --> src/annotationdataset.rs:184:9 [INFO] [stdout] | [INFO] [stdout] 184 | / for data in other.data { [INFO] [stdout] 185 | | if let Some(data) = data { [INFO] [stdout] 186 | | self.insert(data.unbind())?; [INFO] [stdout] 187 | | } [INFO] [stdout] 188 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/annotationdataset.rs:185:13 [INFO] [stdout] | [INFO] [stdout] 185 | / if let Some(data) = data { [INFO] [stdout] 186 | | self.insert(data.unbind())?; [INFO] [stdout] 187 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 184 ~ for data in other.data.into_iter().flatten() { [INFO] [stdout] 185 + self.insert(data.unbind())?; [INFO] [stdout] 186 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.as_ref().map(|x| x.as_str())` on an `Option` value [INFO] [stdout] --> src/annotationdataset.rs:257:9 [INFO] [stdout] | [INFO] [stdout] 257 | self.filename.as_ref().map(|x| x.as_str()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using as_deref: `self.filename.as_deref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_as_ref_deref [INFO] [stdout] = note: `#[warn(clippy::option_as_ref_deref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `self.filename` after checking its variant with `is_some` [INFO] [stdout] --> src/annotationdataset.rs:337:28 [INFO] [stdout] | [INFO] [stdout] 336 | if self.filename.is_some() && self.config.serialize_mode() == SerializeMode::AllowInclude { [INFO] [stdout] | ----------------------- the check is happening here [INFO] [stdout] 337 | let filename = self.filename.as_ref().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/annotationdataset.rs:338:34 [INFO] [stdout] | [INFO] [stdout] 338 | if self.id() != Some(&filename) { [INFO] [stdout] | ^^^^^^^^^ help: change this to: `filename` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/annotationdataset.rs:520:33 [INFO] [stdout] | [INFO] [stdout] 520 | debug(self.config(), || format!("AnnotationDataSet.with_data")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"AnnotationDataSet.with_data".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/annotationdataset.rs:532:33 [INFO] [stdout] | [INFO] [stdout] 532 | debug(self.config(), || format!("AnnotationDataSet.with_data")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"AnnotationDataSet.with_data".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary map of the identity function [INFO] [stdout] --> src/annotationdataset.rs:544:54 [INFO] [stdout] | [INFO] [stdout] 544 | let datakey: Option<&DataKey> = self.key(key).map(|key| key); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: remove the call to `map` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_identity [INFO] [stdout] = note: `#[warn(clippy::map_identity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary map of the identity function [INFO] [stdout] --> src/annotationdataset.rs:666:22 [INFO] [stdout] | [INFO] [stdout] 666 | self.get(key).map(|x| x).ok() [INFO] [stdout] | ^^^^^^^^^^^ help: remove the call to `map` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_identity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Some` variant of the iterator element is used [INFO] [stdout] --> src/annotationdataset.rs:718:9 [INFO] [stdout] | [INFO] [stdout] 718 | / for data in self.data.iter_mut() { [INFO] [stdout] 719 | | if let Some(data) = data { [INFO] [stdout] 720 | | data.id = None; [INFO] [stdout] 721 | | } [INFO] [stdout] 722 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/annotationdataset.rs:719:13 [INFO] [stdout] | [INFO] [stdout] 719 | / if let Some(data) = data { [INFO] [stdout] 720 | | data.id = None; [INFO] [stdout] 721 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 718 ~ for data in self.data.iter_mut().flatten() { [INFO] [stdout] 719 + data.id = None; [INFO] [stdout] 720 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/annotationdataset.rs:859:22 [INFO] [stdout] | [INFO] [stdout] 859 | dataset: &mut self.dataset, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: change this to: `self.dataset` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/annotationdataset.rs:923:21 [INFO] [stdout] | [INFO] [stdout] 923 | let _value: Self::Value = map.next_value()?; //read and discard the value [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] = note: `#[warn(clippy::let_unit_value)]` on by default [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 923 - let _value: Self::Value = map.next_value()?; //read and discard the value [INFO] [stdout] 923 + map.next_value()?; //read and discard the value [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/annotationstore.rs:331:13 [INFO] [stdout] | [INFO] [stdout] 331 | format!("StoreFor.inserted: Indexing annotation") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"StoreFor.inserted: Indexing annotation".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/annotationstore.rs:418:25 [INFO] [stdout] | [INFO] [stdout] 418 | / if self.config.annotation_annotation_map { [INFO] [stdout] 419 | | target_annotations.push((*a_handle, handle)); [INFO] [stdout] 420 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 417 ~ Selector::AnnotationSelector(a_handle, None) [INFO] [stdout] 418 ~ if self.config.annotation_annotation_map => { [INFO] [stdout] 419 | target_annotations.push((*a_handle, handle)); [INFO] [stdout] 420 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/annotationstore.rs:423:25 [INFO] [stdout] | [INFO] [stdout] 423 | / if self.config.textrelationmap { [INFO] [stdout] 424 | | extend_textrelationmap.push((*res_handle, *tsel_handle, handle)); [INFO] [stdout] 425 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 422 ~ Selector::TextSelector(res_handle, tsel_handle, _) [INFO] [stdout] 423 ~ if self.config.textrelationmap => { [INFO] [stdout] 424 | extend_textrelationmap.push((*res_handle, *tsel_handle, handle)); [INFO] [stdout] 425 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/annotationstore.rs:428:25 [INFO] [stdout] | [INFO] [stdout] 428 | / if self.config.resource_annotation_metamap { [INFO] [stdout] 429 | | target_meta_resources.push((*res_handle, handle)); [INFO] [stdout] 430 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 427 ~ Selector::ResourceSelector(res_handle) [INFO] [stdout] 428 ~ if self.config.resource_annotation_metamap => { [INFO] [stdout] 429 | target_meta_resources.push((*res_handle, handle)); [INFO] [stdout] 430 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/annotationstore.rs:433:25 [INFO] [stdout] | [INFO] [stdout] 433 | / if self.config.dataset_annotation_metamap { [INFO] [stdout] 434 | | target_meta_datasets.push((*set_handle, handle)); [INFO] [stdout] 435 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 432 ~ Selector::DataSetSelector(set_handle) [INFO] [stdout] 433 ~ if self.config.dataset_annotation_metamap => { [INFO] [stdout] 434 | target_meta_datasets.push((*set_handle, handle)); [INFO] [stdout] 435 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/annotationstore.rs:438:25 [INFO] [stdout] | [INFO] [stdout] 438 | / if self.config.key_annotation_metamap { [INFO] [stdout] 439 | | target_meta_keys.push((*set_handle, *key_handle, handle)); [INFO] [stdout] 440 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 437 ~ Selector::DataKeySelector(set_handle, key_handle) [INFO] [stdout] 438 ~ if self.config.key_annotation_metamap => { [INFO] [stdout] 439 | target_meta_keys.push((*set_handle, *key_handle, handle)); [INFO] [stdout] 440 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/annotationstore.rs:443:25 [INFO] [stdout] | [INFO] [stdout] 443 | / if self.config.data_annotation_metamap { [INFO] [stdout] 444 | | target_meta_data.push((*set_handle, *data_handle, handle)); [INFO] [stdout] 445 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 442 ~ Selector::AnnotationDataSelector(set_handle, data_handle) [INFO] [stdout] 443 ~ if self.config.data_annotation_metamap => { [INFO] [stdout] 444 | target_meta_data.push((*set_handle, *data_handle, handle)); [INFO] [stdout] 445 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/annotationstore.rs:453:29 [INFO] [stdout] | [INFO] [stdout] 453 | .extend(target_annotations.into_iter()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/91021ccc790478a1a89c003e7d32b8d155ae6aae/library/core/src/iter/traits/collect.rs:416:17 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 453 - .extend(target_annotations.into_iter()); [INFO] [stdout] 453 + .extend(target_annotations); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/annotationstore.rs:458:29 [INFO] [stdout] | [INFO] [stdout] 458 | .extend(target_meta_resources.into_iter()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/91021ccc790478a1a89c003e7d32b8d155ae6aae/library/core/src/iter/traits/collect.rs:416:17 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 458 - .extend(target_meta_resources.into_iter()); [INFO] [stdout] 458 + .extend(target_meta_resources); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/annotationstore.rs:463:29 [INFO] [stdout] | [INFO] [stdout] 463 | .extend(target_meta_datasets.into_iter()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/91021ccc790478a1a89c003e7d32b8d155ae6aae/library/core/src/iter/traits/collect.rs:416:17 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 463 - .extend(target_meta_datasets.into_iter()); [INFO] [stdout] 463 + .extend(target_meta_datasets); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/annotationstore.rs:468:29 [INFO] [stdout] | [INFO] [stdout] 468 | .extend(target_meta_keys.into_iter()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/91021ccc790478a1a89c003e7d32b8d155ae6aae/library/core/src/iter/traits/collect.rs:416:17 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 468 - .extend(target_meta_keys.into_iter()); [INFO] [stdout] 468 + .extend(target_meta_keys); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/annotationstore.rs:473:29 [INFO] [stdout] | [INFO] [stdout] 473 | .extend(target_meta_data.into_iter()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/91021ccc790478a1a89c003e7d32b8d155ae6aae/library/core/src/iter/traits/collect.rs:416:17 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 473 - .extend(target_meta_data.into_iter()); [INFO] [stdout] 473 + .extend(target_meta_data); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/annotationstore.rs:479:29 [INFO] [stdout] | [INFO] [stdout] 479 | .extend(extend_textrelationmap.into_iter()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/91021ccc790478a1a89c003e7d32b8d155ae6aae/library/core/src/iter/traits/collect.rs:416:17 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 479 - .extend(extend_textrelationmap.into_iter()); [INFO] [stdout] 479 + .extend(extend_textrelationmap); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/annotationstore.rs:523:17 [INFO] [stdout] | [INFO] [stdout] 523 | / if let Some(ts_handle) = textselection.handle() { [INFO] [stdout] 524 | | Some((textselection.resource().handle(), ts_handle)) [INFO] [stdout] 525 | | } else { [INFO] [stdout] 526 | | None [INFO] [stdout] 527 | | } [INFO] [stdout] | |_________________^ help: try: `textselection.handle().map(|ts_handle| (textselection.resource().handle(), ts_handle))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead [INFO] [stdout] --> src/annotationstore.rs:683:21 [INFO] [stdout] | [INFO] [stdout] 683 | / >::iter(self) [INFO] [stdout] 684 | | .filter(|substore| substore.parents.contains(&None)) [INFO] [stdout] 685 | | .next() [INFO] [stdout] | |_______________________________^ help: try: `>::iter(self).find(|substore| substore.parents.contains(&None))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next [INFO] [stdout] = note: `#[warn(clippy::filter_next)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Some` variant of the iterator element is used [INFO] [stdout] --> src/annotationstore.rs:730:9 [INFO] [stdout] | [INFO] [stdout] 730 | / for annotation in self.store.iter() { [INFO] [stdout] 731 | | if let Some(annotation) = annotation { [INFO] [stdout] 732 | | if self [INFO] [stdout] 733 | | .parent [INFO] [stdout] ... | [INFO] [stdout] 742 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/annotationstore.rs:731:13 [INFO] [stdout] | [INFO] [stdout] 731 | / if let Some(annotation) = annotation { [INFO] [stdout] 732 | | if self [INFO] [stdout] 733 | | .parent [INFO] [stdout] 734 | | .annotation_substore_map [INFO] [stdout] ... | [INFO] [stdout] 741 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 730 ~ for annotation in self.store.iter().flatten() { [INFO] [stdout] 731 + if self [INFO] [stdout] 732 + .parent [INFO] [stdout] 733 + .annotation_substore_map [INFO] [stdout] 734 + .get(annotation.handle().expect("annotation must have handle")) [INFO] [stdout] 735 + == self.substore [INFO] [stdout] 736 + //output the selected substore (or main store) only [INFO] [stdout] 737 + { [INFO] [stdout] 738 + seq.serialize_element(&annotation.as_resultitem(self.parent, self.parent))?; [INFO] [stdout] 739 + } [INFO] [stdout] 740 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Some` variant of the iterator element is used [INFO] [stdout] --> src/annotationstore.rs:753:9 [INFO] [stdout] | [INFO] [stdout] 753 | / for resource in self.store.iter() { [INFO] [stdout] 754 | | if let Some(resource) = resource { [INFO] [stdout] 755 | | let found_substores = self [INFO] [stdout] 756 | | .parent [INFO] [stdout] ... | [INFO] [stdout] 768 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/annotationstore.rs:754:13 [INFO] [stdout] | [INFO] [stdout] 754 | / if let Some(resource) = resource { [INFO] [stdout] 755 | | let found_substores = self [INFO] [stdout] 756 | | .parent [INFO] [stdout] 757 | | .resource_substore_map [INFO] [stdout] ... | [INFO] [stdout] 767 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 753 ~ for resource in self.store.iter().flatten() { [INFO] [stdout] 754 + let found_substores = self [INFO] [stdout] 755 + .parent [INFO] [stdout] 756 + .resource_substore_map [INFO] [stdout] 757 + .get(resource.handle().expect("resource must have handle")); [INFO] [stdout] 758 + if (found_substores.is_none() && self.substore.is_none()) [INFO] [stdout] 759 + || (found_substores.is_some() [INFO] [stdout] 760 + && self.substore.is_some() [INFO] [stdout] 761 + && found_substores.unwrap().contains(&self.substore.unwrap())) [INFO] [stdout] 762 + //output the selected substore (or main store) only [INFO] [stdout] 763 + { [INFO] [stdout] 764 + seq.serialize_element(resource)?; [INFO] [stdout] 765 + } [INFO] [stdout] 766 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Some` variant of the iterator element is used [INFO] [stdout] --> src/annotationstore.rs:779:9 [INFO] [stdout] | [INFO] [stdout] 779 | / for dataset in self.store.iter() { [INFO] [stdout] 780 | | if let Some(dataset) = dataset { [INFO] [stdout] 781 | | let found_substores = self [INFO] [stdout] 782 | | .parent [INFO] [stdout] ... | [INFO] [stdout] 794 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/annotationstore.rs:780:13 [INFO] [stdout] | [INFO] [stdout] 780 | / if let Some(dataset) = dataset { [INFO] [stdout] 781 | | let found_substores = self [INFO] [stdout] 782 | | .parent [INFO] [stdout] 783 | | .dataset_substore_map [INFO] [stdout] ... | [INFO] [stdout] 793 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 779 ~ for dataset in self.store.iter().flatten() { [INFO] [stdout] 780 + let found_substores = self [INFO] [stdout] 781 + .parent [INFO] [stdout] 782 + .dataset_substore_map [INFO] [stdout] 783 + .get(dataset.handle().expect("dataset must have handle")); [INFO] [stdout] 784 + if (found_substores.is_none() && self.substore.is_none()) [INFO] [stdout] 785 + || (found_substores.is_some() [INFO] [stdout] 786 + && self.substore.is_some() [INFO] [stdout] 787 + && found_substores.unwrap().contains(&self.substore.unwrap())) [INFO] [stdout] 788 + //output the selected substore (or main store) only [INFO] [stdout] 789 + { [INFO] [stdout] 790 + seq.serialize_element(dataset)?; [INFO] [stdout] 791 + } [INFO] [stdout] 792 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.as_ref().map(|v| &**v)` on an `Option` value [INFO] [stdout] --> src/annotationstore.rs:865:36 [INFO] [stdout] | [INFO] [stdout] 865 | get_filepath(filename, new_config.workdir.as_ref().map(|v| &**v))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using as_deref: `new_config.workdir.as_deref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_as_ref_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/annotationstore.rs:1012:15 [INFO] [stdout] | [INFO] [stdout] 1012 | debug(&self.config(), || format!("AnnotationStore::new_config")); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `self.config()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/annotationstore.rs:1012:34 [INFO] [stdout] | [INFO] [stdout] 1012 | debug(&self.config(), || format!("AnnotationStore::new_config")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"AnnotationStore::new_config".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.as_ref().map(|x| x.as_path())` on an `Option` value [INFO] [stdout] --> src/annotationstore.rs:1079:9 [INFO] [stdout] | [INFO] [stdout] 1079 | self.annotations_filename.as_ref().map(|x| x.as_path()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using as_deref: `self.annotations_filename.as_deref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_as_ref_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/annotationstore.rs:1166:70 [INFO] [stdout] | [INFO] [stdout] 1166 | return Err(StamError::SerializationError(format!( [INFO] [stdout] | ______________________________________________________________________^ [INFO] [stdout] 1167 | | "Unable to infer a filename for annotationset. Has neither filename nor ID.", [INFO] [stdout] 1168 | | ))); [INFO] [stdout] | |_____________________^ help: consider using `.to_string()`: `"Unable to infer a filename for annotationset. Has neither filename nor ID.".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/annotationstore.rs:1203:54 [INFO] [stdout] | [INFO] [stdout] 1203 | return Err(StamError::SerializationError(format!( [INFO] [stdout] | ______________________________________________________^ [INFO] [stdout] 1204 | | "Unable to infer a filename for AnnotationStore. Has neither filename nor ID.", [INFO] [stdout] 1205 | | ))); [INFO] [stdout] | |_____________^ help: consider using `.to_string()`: `"Unable to infer a filename for AnnotationStore. Has neither filename nor ID.".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct pattern is not needed for a unit variant [INFO] [stdout] --> src/annotationstore.rs:1253:33 [INFO] [stdout] | [INFO] [stdout] 1253 | DataFormat::CBOR { .. } => { [INFO] [stdout] | ^^^^^^^ help: remove the struct pattern [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unneeded_struct_pattern [INFO] [stdout] = note: `#[warn(clippy::unneeded_struct_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/annotationstore.rs:1300:13 [INFO] [stdout] | [INFO] [stdout] 1300 | format!("AnnotationStore::propagate_full_config()") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"AnnotationStore::propagate_full_config()".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/annotationstore.rs:1617:25 [INFO] [stdout] | [INFO] [stdout] 1617 | / if res == res2 && tsel2.as_usize() == tsel.as_usize() + 1 { [INFO] [stdout] 1618 | | substitute = Some(Selector::RangedTextSelector { [INFO] [stdout] 1619 | | resource: *res, [INFO] [stdout] 1620 | | begin: *tsel, [INFO] [stdout] 1621 | | end: *tsel2, [INFO] [stdout] 1622 | | }); [INFO] [stdout] 1623 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1616 ~ ) [INFO] [stdout] 1617 ~ if res == res2 && tsel2.as_usize() == tsel.as_usize() + 1 => { [INFO] [stdout] 1618 | substitute = Some(Selector::RangedTextSelector { [INFO] [stdout] ... [INFO] [stdout] 1622 | }); [INFO] [stdout] 1623 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/annotationstore.rs:1633:25 [INFO] [stdout] | [INFO] [stdout] 1633 | / if resource == res2 && tsel2.as_usize() == end.as_usize() + 1 { [INFO] [stdout] 1634 | | substitute = Some(Selector::RangedTextSelector { [INFO] [stdout] 1635 | | resource: *resource, [INFO] [stdout] 1636 | | begin: *begin, [INFO] [stdout] 1637 | | end: *tsel2, [INFO] [stdout] 1638 | | }); [INFO] [stdout] 1639 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1632 ~ ) [INFO] [stdout] 1633 ~ if resource == res2 && tsel2.as_usize() == end.as_usize() + 1 => { [INFO] [stdout] 1634 | substitute = Some(Selector::RangedTextSelector { [INFO] [stdout] ... [INFO] [stdout] 1638 | }); [INFO] [stdout] 1639 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/annotationstore.rs:1645:25 [INFO] [stdout] | [INFO] [stdout] 1645 | / if annotation2.as_usize() == annotation.as_usize() + 1 { [INFO] [stdout] 1646 | | substitute = Some(Selector::RangedAnnotationSelector { [INFO] [stdout] 1647 | | begin: *annotation, [INFO] [stdout] 1648 | | end: *annotation2, [INFO] [stdout] 1649 | | with_text: false, [INFO] [stdout] 1650 | | }); [INFO] [stdout] 1651 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1644 ~ ) [INFO] [stdout] 1645 ~ if annotation2.as_usize() == annotation.as_usize() + 1 => { [INFO] [stdout] 1646 | substitute = Some(Selector::RangedAnnotationSelector { [INFO] [stdout] ... [INFO] [stdout] 1650 | }); [INFO] [stdout] 1651 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/annotationstore.rs:1661:25 [INFO] [stdout] | [INFO] [stdout] 1661 | / if annotation.as_usize() == end.as_usize() + 1 { [INFO] [stdout] 1662 | | substitute = Some(Selector::RangedAnnotationSelector { [INFO] [stdout] 1663 | | begin: *begin, [INFO] [stdout] 1664 | | end: *annotation, [INFO] [stdout] 1665 | | with_text: false, [INFO] [stdout] 1666 | | }); [INFO] [stdout] 1667 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1660 ~ ) [INFO] [stdout] 1661 ~ if annotation.as_usize() == end.as_usize() + 1 => { [INFO] [stdout] 1662 | substitute = Some(Selector::RangedAnnotationSelector { [INFO] [stdout] ... [INFO] [stdout] 1666 | }); [INFO] [stdout] 1667 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/annotationstore.rs:1673:25 [INFO] [stdout] | [INFO] [stdout] 1673 | / ... if annotation2.as_usize() == annotation.as_usize() + 1 { [INFO] [stdout] 1674 | | ... //we can only merge annotations that reference the entire underlying annotation's text and not a subpart of it [INFO] [stdout] 1675 | | ... if let (Some(offset), Some(offset2)) = ( [INFO] [stdout] 1676 | | ... last.offset_with_mode(self, Some(OffsetMode::BeginEnd)), [INFO] [stdout] ... | [INFO] [stdout] 1691 | | ... } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1672 ~ ) [INFO] [stdout] 1673 ~ if annotation2.as_usize() == annotation.as_usize() + 1 => { [INFO] [stdout] 1674 | //we can only merge annotations that reference the entire underlying annotation's text and not a subpart of it [INFO] [stdout] ... [INFO] [stdout] 1690 | } [INFO] [stdout] 1691 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/annotationstore.rs:1701:25 [INFO] [stdout] | [INFO] [stdout] 1701 | / ... if annotation.as_usize() == end.as_usize() + 1 { [INFO] [stdout] 1702 | | ... //we can only merge annotations that reference the entire underlying annotation's text and not a subpart of it [INFO] [stdout] 1703 | | ... if let Some(offset) = [INFO] [stdout] 1704 | | ... selector.offset_with_mode(self, Some(OffsetMode::BeginEnd)) [INFO] [stdout] ... | [INFO] [stdout] 1716 | | ... } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1700 ~ ) [INFO] [stdout] 1701 ~ if annotation.as_usize() == end.as_usize() + 1 => { [INFO] [stdout] 1702 | //we can only merge annotations that reference the entire underlying annotation's text and not a subpart of it [INFO] [stdout] ... [INFO] [stdout] 1715 | } [INFO] [stdout] 1716 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'store [INFO] [stdout] --> src/annotationstore.rs:1733:46 [INFO] [stdout] | [INFO] [stdout] 1733 | pub(crate) fn textselections_by_selector<'store>( [INFO] [stdout] | ^^^^^^ [INFO] [stdout] 1734 | &'store self, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 1733 ~ pub(crate) fn textselections_by_selector( [INFO] [stdout] 1734 ~ &self, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/annotationstore.rs:1777:36 [INFO] [stdout] | [INFO] [stdout] 1777 | results.extend(self.textselections_by_selector(subselector).into_iter()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/91021ccc790478a1a89c003e7d32b8d155ae6aae/library/core/src/iter/traits/collect.rs:416:17 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 1777 - results.extend(self.textselections_by_selector(subselector).into_iter()) [INFO] [stdout] 1777 + results.extend(self.textselections_by_selector(subselector)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/annotationstore.rs:1799:10 [INFO] [stdout] | [INFO] [stdout] 1799 | ) -> ( [INFO] [stdout] | __________^ [INFO] [stdout] 1800 | | usize, [INFO] [stdout] 1801 | | usize, [INFO] [stdout] 1802 | | usize, [INFO] [stdout] ... | [INFO] [stdout] 1813 | | usize, [INFO] [stdout] 1814 | | ) { [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/annotationstore.rs:1869:10 [INFO] [stdout] | [INFO] [stdout] 1869 | ) -> ( [INFO] [stdout] | __________^ [INFO] [stdout] 1870 | | usize, [INFO] [stdout] 1871 | | usize, [INFO] [stdout] 1872 | | usize, [INFO] [stdout] ... | [INFO] [stdout] 1883 | | usize, [INFO] [stdout] 1884 | | ) { [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Some` variant of the iterator element is used [INFO] [stdout] --> src/annotationstore.rs:1920:13 [INFO] [stdout] | [INFO] [stdout] 1920 | / for resource in self.resources.iter_mut() { [INFO] [stdout] 1921 | | if let Some(resource) = resource { [INFO] [stdout] 1922 | | resource.shrink_to_fit(); [INFO] [stdout] 1923 | | } [INFO] [stdout] 1924 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/annotationstore.rs:1921:17 [INFO] [stdout] | [INFO] [stdout] 1921 | / if let Some(resource) = resource { [INFO] [stdout] 1922 | | resource.shrink_to_fit(); [INFO] [stdout] 1923 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1920 ~ for resource in self.resources.iter_mut().flatten() { [INFO] [stdout] 1921 + resource.shrink_to_fit(); [INFO] [stdout] 1922 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Some` variant of the iterator element is used [INFO] [stdout] --> src/annotationstore.rs:1925:13 [INFO] [stdout] | [INFO] [stdout] 1925 | / for annotationset in self.annotationsets.iter_mut() { [INFO] [stdout] 1926 | | if let Some(annotationset) = annotationset { [INFO] [stdout] 1927 | | annotationset.shrink_to_fit(); [INFO] [stdout] 1928 | | } [INFO] [stdout] 1929 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/annotationstore.rs:1926:17 [INFO] [stdout] | [INFO] [stdout] 1926 | / if let Some(annotationset) = annotationset { [INFO] [stdout] 1927 | | annotationset.shrink_to_fit(); [INFO] [stdout] 1928 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1925 ~ for annotationset in self.annotationsets.iter_mut().flatten() { [INFO] [stdout] 1926 + annotationset.shrink_to_fit(); [INFO] [stdout] 1927 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Some` variant of the iterator element is used [INFO] [stdout] --> src/annotationstore.rs:1997:9 [INFO] [stdout] | [INFO] [stdout] 1997 | / for annotation in self.annotations.iter_mut() { [INFO] [stdout] 1998 | | if let Some(annotation) = annotation { [INFO] [stdout] 1999 | | annotation.id = None; [INFO] [stdout] 2000 | | } [INFO] [stdout] 2001 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/annotationstore.rs:1998:13 [INFO] [stdout] | [INFO] [stdout] 1998 | / if let Some(annotation) = annotation { [INFO] [stdout] 1999 | | annotation.id = None; [INFO] [stdout] 2000 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1997 ~ for annotation in self.annotations.iter_mut().flatten() { [INFO] [stdout] 1998 + annotation.id = None; [INFO] [stdout] 1999 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Some` variant of the iterator element is used [INFO] [stdout] --> src/annotationstore.rs:2009:9 [INFO] [stdout] | [INFO] [stdout] 2009 | / for annotationset in self.annotationsets.iter_mut() { [INFO] [stdout] 2010 | | if let Some(annotationset) = annotationset { [INFO] [stdout] 2011 | | annotationset.strip_data_ids(); [INFO] [stdout] 2012 | | } [INFO] [stdout] 2013 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/annotationstore.rs:2010:13 [INFO] [stdout] | [INFO] [stdout] 2010 | / if let Some(annotationset) = annotationset { [INFO] [stdout] 2011 | | annotationset.strip_data_ids(); [INFO] [stdout] 2012 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 2009 ~ for annotationset in self.annotationsets.iter_mut().flatten() { [INFO] [stdout] 2010 + annotationset.strip_data_ids(); [INFO] [stdout] 2011 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/annotationstore.rs:2153:21 [INFO] [stdout] | [INFO] [stdout] 2153 | format!("AnnotationStore.set_filename: Changing dataformat to JSON") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"AnnotationStore.set_filename: Changing dataformat to JSON".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/annotationstore.rs:2163:17 [INFO] [stdout] | [INFO] [stdout] 2163 | format!("AnnotationStore.set_filename: Changing dataformat to CSV") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"AnnotationStore.set_filename: Changing dataformat to CSV".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/annotationstore.rs:2171:17 [INFO] [stdout] | [INFO] [stdout] 2171 | format!("AnnotationStore.set_filename: Changing dataformat to CBOR") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"AnnotationStore.set_filename: Changing dataformat to CBOR".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/annotationstore.rs:2197:9 [INFO] [stdout] | [INFO] [stdout] 2197 | / if let Some(textselection_annotationmap) = [INFO] [stdout] 2198 | | self.textrelationmap.data.get(resource_handle.as_usize()) [INFO] [stdout] 2199 | | { [INFO] [stdout] 2200 | | Some( [INFO] [stdout] ... | [INFO] [stdout] 2207 | | None [INFO] [stdout] 2208 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 2197 ~ self.textrelationmap.data.get(resource_handle.as_usize()).map(|textselection_annotationmap| textselection_annotationmap [INFO] [stdout] 2198 + .data [INFO] [stdout] 2199 + .iter() [INFO] [stdout] 2200 + .flat_map(|v| v.iter().copied())) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/annotationstore.rs:2257:9 [INFO] [stdout] | [INFO] [stdout] 2257 | if let Some(resource) = self.get(resource_handle).ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] = note: `#[warn(clippy::match_result_ok)]` on by default [INFO] [stdout] help: consider matching on `Ok(resource)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 2257 - if let Some(resource) = self.get(resource_handle).ok() { [INFO] [stdout] 2257 + if let Ok(resource) = self.get(resource_handle) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/annotationstore.rs:2258:82 [INFO] [stdout] | [INFO] [stdout] 2258 | if let Ok(Some(textselection_handle)) = resource.known_textselection(&offset) { [INFO] [stdout] | ^^^^^^^ help: change this to: `offset` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/annotationstore.rs:2394:20 [INFO] [stdout] | [INFO] [stdout] 2394 | store: &mut self.store, [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: change this to: `self.store` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/annotationstore.rs:2453:87 [INFO] [stdout] | [INFO] [stdout] 2453 | ... return Err(::custom(format!( [INFO] [stdout] | _________________________________________________________________________^ [INFO] [stdout] 2454 | | ... "Expected string elements inside @include array in AnnotationStore, got something else" [INFO] [stdout] 2455 | | ... ))); [INFO] [stdout] | |_______________________^ help: consider using `.to_string()`: `"Expected string elements inside @include array in AnnotationStore, got something else".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/annotationstore.rs:2461:79 [INFO] [stdout] | [INFO] [stdout] 2461 | ... return Err(::custom(format!( [INFO] [stdout] | _________________________________________________________________________^ [INFO] [stdout] 2462 | | ... "Expected string or array for @include in AnnotationStore, got something else" [INFO] [stdout] 2463 | | ... ))); [INFO] [stdout] | |_______________________^ help: consider using `.to_string()`: `"Expected string or array for @include in AnnotationStore, got something else".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/annotationstore.rs:2491:21 [INFO] [stdout] | [INFO] [stdout] 2491 | let _value: Self::Value = map.next_value()?; //read and discard the value [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 2491 - let _value: Self::Value = map.next_value()?; //read and discard the value [INFO] [stdout] 2491 + map.next_value()?; //read and discard the value [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `while let` loop [INFO] [stdout] --> src/annotationstore.rs:2625:9 [INFO] [stdout] | [INFO] [stdout] 2625 | / loop { [INFO] [stdout] 2626 | | if let Some(resource) = [INFO] [stdout] 2627 | | seq.next_element_seed(DeserializeTextResource::new(self.store.new_config()))? [INFO] [stdout] ... | [INFO] [stdout] 2652 | | } [INFO] [stdout] | |_________^ help: try: `while let Some(resource) = seq.next_element_seed(DeserializeTextResource::new(self.store.new_config()))? { .. }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_loop [INFO] [stdout] = note: `#[warn(clippy::while_let_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/annotation.rs:128:40 [INFO] [stdout] | [INFO] [stdout] 128 | Handles::new(Cow::Borrowed(&annotations), true, self.store()) [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `annotations` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/api/annotation.rs:306:33 [INFO] [stdout] | [INFO] [stdout] 306 | .or_insert_with(move || Vec::new()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Vec::new` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: iterating on a map's values [INFO] [stdout] --> src/api/annotation.rs:309:9 [INFO] [stdout] | [INFO] [stdout] 309 | map.into_iter().map(|(_, v)| v.into_iter().collect()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.into_values().map(|v| v.into_iter().collect())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map [INFO] [stdout] = note: `#[warn(clippy::iter_kv_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/annotation.rs:413:14 [INFO] [stdout] | [INFO] [stdout] 413 | .map(|annotation| annotation.annotations()) [INFO] [stdout] | ______________^ [INFO] [stdout] 414 | | .flatten() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|annotation| annotation.annotations())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] = note: `#[warn(clippy::map_flatten)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/annotation.rs:431:18 [INFO] [stdout] | [INFO] [stdout] 431 | self.map(|annotation| annotation.annotations()).flatten(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|annotation| annotation.annotations())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/annotation.rs:443:14 [INFO] [stdout] | [INFO] [stdout] 443 | .map(|annotation| annotation.annotations_in_targets(depth)) [INFO] [stdout] | ______________^ [INFO] [stdout] 444 | | .flatten() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|annotation| annotation.annotations_in_targets(depth))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/annotation.rs:457:37 [INFO] [stdout] | [INFO] [stdout] 457 | let mut data: Vec<_> = self.map(|annotation| annotation.data()).flatten().collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|annotation| annotation.data())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/annotation.rs:471:18 [INFO] [stdout] | [INFO] [stdout] 471 | self.map(|annotation| annotation.data()).flatten(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|annotation| annotation.data())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/annotation.rs:480:14 [INFO] [stdout] | [INFO] [stdout] 480 | .map(|annotation| annotation.data_as_metadata()) [INFO] [stdout] | ______________^ [INFO] [stdout] 481 | | .flatten() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|annotation| annotation.data_as_metadata())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/annotation.rs:490:37 [INFO] [stdout] | [INFO] [stdout] 490 | let mut keys: Vec<_> = self.map(|annotation| annotation.keys()).flatten().collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|annotation| annotation.keys())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/annotation.rs:501:14 [INFO] [stdout] | [INFO] [stdout] 501 | .map(|annotation| annotation.keys_as_metadata()) [INFO] [stdout] | ______________^ [INFO] [stdout] 502 | | .flatten() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|annotation| annotation.keys_as_metadata())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: mutable key type [INFO] [stdout] --> src/api/annotation.rs:521:9 [INFO] [stdout] | [INFO] [stdout] 521 | / let collection: BTreeSet<_> = self [INFO] [stdout] 522 | | .map(|annotation| annotation.resources_as_metadata()) [INFO] [stdout] 523 | | .flatten() [INFO] [stdout] 524 | | .collect(); [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = note: ... because it contains `ResultItem<'_, TextResource>`, which has interior mutability [INFO] [stdout] = note: ... because it contains `&TextResource`, which has interior mutability [INFO] [stdout] = note: ... because it contains `TextResource`, which has interior mutability [INFO] [stdout] = note: ... because it contains `Arc>`, which has interior mutability [INFO] [stdout] = note: ... because it contains `RwLock`, which has interior mutability [INFO] [stdout] = note: ... because it contains `RwLock`, which has interior mutability [INFO] [stdout] = note: ... because it contains `Atomic`, which has interior mutability [INFO] [stdout] = note: ... because it contains `UnsafeCell<::Storage>`, which has interior mutability [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mutable_key_type [INFO] [stdout] = note: `#[warn(clippy::mutable_key_type)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/annotation.rs:522:14 [INFO] [stdout] | [INFO] [stdout] 522 | .map(|annotation| annotation.resources_as_metadata()) [INFO] [stdout] | ______________^ [INFO] [stdout] 523 | | .flatten() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|annotation| annotation.resources_as_metadata())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: mutable key type [INFO] [stdout] --> src/api/annotation.rs:533:9 [INFO] [stdout] | [INFO] [stdout] 533 | / let collection: BTreeSet<_> = self [INFO] [stdout] 534 | | .map(|annotation| annotation.resources()) [INFO] [stdout] 535 | | .flatten() [INFO] [stdout] 536 | | .collect(); [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = note: ... because it contains `ResultItem<'_, TextResource>`, which has interior mutability [INFO] [stdout] = note: ... because it contains `&TextResource`, which has interior mutability [INFO] [stdout] = note: ... because it contains `TextResource`, which has interior mutability [INFO] [stdout] = note: ... because it contains `Arc>`, which has interior mutability [INFO] [stdout] = note: ... because it contains `RwLock`, which has interior mutability [INFO] [stdout] = note: ... because it contains `RwLock`, which has interior mutability [INFO] [stdout] = note: ... because it contains `Atomic`, which has interior mutability [INFO] [stdout] = note: ... because it contains `UnsafeCell<::Storage>`, which has interior mutability [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mutable_key_type [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/annotation.rs:534:14 [INFO] [stdout] | [INFO] [stdout] 534 | .map(|annotation| annotation.resources()) [INFO] [stdout] | ______________^ [INFO] [stdout] 535 | | .flatten() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|annotation| annotation.resources())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/annotation.rs:542:14 [INFO] [stdout] | [INFO] [stdout] 542 | self.map(|annotation| annotation.textselections()) [INFO] [stdout] | ______________^ [INFO] [stdout] 543 | | .flatten() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|annotation| annotation.textselections())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/annotation.rs:557:14 [INFO] [stdout] | [INFO] [stdout] 557 | self.map(|annotation| annotation.related_text(operator)) [INFO] [stdout] | ______________^ [INFO] [stdout] 558 | | .flatten() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|annotation| annotation.related_text(operator))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/annotation.rs:1079:52 [INFO] [stdout] | [INFO] [stdout] 1079 | annotation.data().filter_any_byref(&data).test() [INFO] [stdout] | ^^^^^ help: change this to: `data` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/annotationdata.rs:119:14 [INFO] [stdout] | [INFO] [stdout] 119 | .map(|annotation| annotation.resources_as_metadata()) [INFO] [stdout] | ______________^ [INFO] [stdout] 120 | | .flatten() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|annotation| annotation.resources_as_metadata())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/annotationdata.rs:130:14 [INFO] [stdout] | [INFO] [stdout] 130 | .map(|annotation| annotation.resources()) [INFO] [stdout] | ______________^ [INFO] [stdout] 131 | | .flatten() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|annotation| annotation.resources())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/annotationdata.rs:141:14 [INFO] [stdout] | [INFO] [stdout] 141 | .map(|annotation| annotation.datasets()) [INFO] [stdout] | ______________^ [INFO] [stdout] 142 | | .flatten() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|annotation| annotation.datasets())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/annotationdata.rs:214:44 [INFO] [stdout] | [INFO] [stdout] 214 | let mut annotations: Vec<_> = self.map(|data| data.annotations()).flatten().collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|data| data.annotations())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/annotationdata.rs:230:14 [INFO] [stdout] | [INFO] [stdout] 230 | .map(|data| data.annotations_as_metadata()) [INFO] [stdout] | ______________^ [INFO] [stdout] 231 | | .flatten() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|data| data.annotations_as_metadata())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/annotationdata.rs:426:67 [INFO] [stdout] | [INFO] [stdout] 426 | Filter::DataOperator(operator, _) => data.test(false, &operator), [INFO] [stdout] | ^^^^^^^^^ help: change this to: `operator` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/annotationdata.rs:430:41 [INFO] [stdout] | [INFO] [stdout] 430 | && data.test(false, &operator) [INFO] [stdout] | ^^^^^^^^^ help: change this to: `operator` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'store [INFO] [stdout] --> src/api/annotationstore.rs:220:46 [INFO] [stdout] | [INFO] [stdout] 220 | pub(crate) fn find_data_request_resolver<'store>( [INFO] [stdout] | ^^^^^^ [INFO] [stdout] 221 | &'store self, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 220 ~ pub(crate) fn find_data_request_resolver( [INFO] [stdout] 221 ~ &self, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this block may be rewritten with the `?` operator [INFO] [stdout] --> src/api/annotationstore.rs:233:21 [INFO] [stdout] | [INFO] [stdout] 233 | / if test_key_handle.is_none() { [INFO] [stdout] 234 | | //requested key doesn't exist, bail out early, we won't find anything at all [INFO] [stdout] 235 | | return None; [INFO] [stdout] 236 | | } [INFO] [stdout] | |_____________________^ help: replace it with: `test_key_handle?;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] = note: `#[warn(clippy::question_mark)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/annotationstore.rs:325:22 [INFO] [stdout] | [INFO] [stdout] 325 | .map(move |dataset| { [INFO] [stdout] | ______________________^ [INFO] [stdout] 326 | | dataset.as_ref().data().filter_map(move |annotationdata| { [INFO] [stdout] 327 | | if key_handle.is_none() || key_handle.unwrap() == annotationdata.key() { [INFO] [stdout] 328 | | Some(annotationdata.as_resultitem(dataset.as_ref(), rootstore)) [INFO] [stdout] ... | [INFO] [stdout] 333 | | }) [INFO] [stdout] 334 | | .flatten(), [INFO] [stdout] | |______________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] help: try replacing `map` with `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 325 ~ .flat_map(move |dataset| { [INFO] [stdout] 326 + dataset.as_ref().data().filter_map(move |annotationdata| { [INFO] [stdout] 327 + if key_handle.is_none() || key_handle.unwrap() == annotationdata.key() { [INFO] [stdout] 328 + Some(annotationdata.as_resultitem(dataset.as_ref(), rootstore)) [INFO] [stdout] 329 + } else { [INFO] [stdout] 330 + None [INFO] [stdout] 331 + } [INFO] [stdout] 332 + }) [INFO] [stdout] 333 ~ }), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: mutable key type [INFO] [stdout] --> src/api/annotationstore.rs:359:9 [INFO] [stdout] | [INFO] [stdout] 359 | / let keys: BTreeSet<_> = self [INFO] [stdout] 360 | | .datasets() [INFO] [stdout] 361 | | .map(|dataset| dataset.keys()) [INFO] [stdout] 362 | | .flatten() [INFO] [stdout] 363 | | .collect(); [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = note: ... because it contains `ResultItem<'_, DataKey>`, which has interior mutability [INFO] [stdout] = note: ... because it contains `&::StoreType`, which has interior mutability [INFO] [stdout] = note: ... because it contains `::StoreType`, which has interior mutability [INFO] [stdout] = note: ... because it contains `AnnotationDataSet`, which has interior mutability [INFO] [stdout] = note: ... because it contains `Arc>`, which has interior mutability [INFO] [stdout] = note: ... because it contains `RwLock`, which has interior mutability [INFO] [stdout] = note: ... because it contains `RwLock`, which has interior mutability [INFO] [stdout] = note: ... because it contains `Atomic`, which has interior mutability [INFO] [stdout] = note: ... because it contains `UnsafeCell<::Storage>`, which has interior mutability [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mutable_key_type [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/annotationstore.rs:361:14 [INFO] [stdout] | [INFO] [stdout] 361 | .map(|dataset| dataset.keys()) [INFO] [stdout] | ______________^ [INFO] [stdout] 362 | | .flatten() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|dataset| dataset.keys())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::iter::Map>>, {closure@src/api/annotationstore.rs:409:18: 409:24}>` [INFO] [stdout] --> src/api/annotationstore.rs:408:9 [INFO] [stdout] | [INFO] [stdout] 408 | / self.find_data(set, key, value) [INFO] [stdout] 409 | | .map(|data| { [INFO] [stdout] 410 | | data.resources_as_metadata() [INFO] [stdout] 411 | | .into_iter() [INFO] [stdout] 412 | | .map(move |resource| (resource, data.clone())) [INFO] [stdout] 413 | | }) [INFO] [stdout] 414 | | .into_iter() [INFO] [stdout] | |________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 408 ~ self.find_data(set, key, value) [INFO] [stdout] 409 + .map(|data| { [INFO] [stdout] 410 + data.resources_as_metadata() [INFO] [stdout] 411 + .into_iter() [INFO] [stdout] 412 + .map(move |resource| (resource, data.clone())) [INFO] [stdout] 413 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::collections::btree_set::IntoIter>` [INFO] [stdout] --> src/api/annotationstore.rs:410:17 [INFO] [stdout] | [INFO] [stdout] 410 | / data.resources_as_metadata() [INFO] [stdout] 411 | | .into_iter() [INFO] [stdout] | |________________________________^ help: consider removing `.into_iter()`: `data.resources_as_metadata()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::iter::Map>>, {closure@src/api/annotationstore.rs:441:18: 441:24}>` [INFO] [stdout] --> src/api/annotationstore.rs:440:9 [INFO] [stdout] | [INFO] [stdout] 440 | / self.find_data(set, key, value) [INFO] [stdout] 441 | | .map(|data| { [INFO] [stdout] 442 | | data.datasets() [INFO] [stdout] 443 | | .into_iter() [INFO] [stdout] 444 | | .map(move |dataset| (dataset, data.clone())) [INFO] [stdout] 445 | | }) [INFO] [stdout] 446 | | .into_iter() [INFO] [stdout] | |________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 440 ~ self.find_data(set, key, value) [INFO] [stdout] 441 + .map(|data| { [INFO] [stdout] 442 + data.datasets() [INFO] [stdout] 443 + .into_iter() [INFO] [stdout] 444 + .map(move |dataset| (dataset, data.clone())) [INFO] [stdout] 445 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::collections::btree_set::IntoIter>` [INFO] [stdout] --> src/api/annotationstore.rs:442:17 [INFO] [stdout] | [INFO] [stdout] 442 | / data.datasets() [INFO] [stdout] 443 | | .into_iter() [INFO] [stdout] | |________________________________^ help: consider removing `.into_iter()`: `data.datasets()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: mutable key type [INFO] [stdout] --> src/api/datakey.rs:106:44 [INFO] [stdout] | [INFO] [stdout] 106 | pub fn resources_as_metadata(&self) -> BTreeSet> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: ... because it contains `ResultItem<'store, TextResource>`, which has interior mutability [INFO] [stdout] = note: ... because it contains `&TextResource`, which has interior mutability [INFO] [stdout] = note: ... because it contains `TextResource`, which has interior mutability [INFO] [stdout] = note: ... because it contains `Arc>`, which has interior mutability [INFO] [stdout] = note: ... because it contains `RwLock`, which has interior mutability [INFO] [stdout] = note: ... because it contains `RwLock`, which has interior mutability [INFO] [stdout] = note: ... because it contains `Atomic`, which has interior mutability [INFO] [stdout] = note: ... because it contains `UnsafeCell<::Storage>`, which has interior mutability [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mutable_key_type [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/datakey.rs:108:14 [INFO] [stdout] | [INFO] [stdout] 108 | .map(|annotation| annotation.resources_as_metadata()) [INFO] [stdout] | ______________^ [INFO] [stdout] 109 | | .flatten() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|annotation| annotation.resources_as_metadata())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: mutable key type [INFO] [stdout] --> src/api/datakey.rs:114:32 [INFO] [stdout] | [INFO] [stdout] 114 | pub fn resources(&self) -> BTreeSet> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: ... because it contains `ResultItem<'store, TextResource>`, which has interior mutability [INFO] [stdout] = note: ... because it contains `&TextResource`, which has interior mutability [INFO] [stdout] = note: ... because it contains `TextResource`, which has interior mutability [INFO] [stdout] = note: ... because it contains `Arc>`, which has interior mutability [INFO] [stdout] = note: ... because it contains `RwLock`, which has interior mutability [INFO] [stdout] = note: ... because it contains `RwLock`, which has interior mutability [INFO] [stdout] = note: ... because it contains `Atomic`, which has interior mutability [INFO] [stdout] = note: ... because it contains `UnsafeCell<::Storage>`, which has interior mutability [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mutable_key_type [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/datakey.rs:116:14 [INFO] [stdout] | [INFO] [stdout] 116 | .map(|annotation| annotation.resources()) [INFO] [stdout] | ______________^ [INFO] [stdout] 117 | | .flatten() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|annotation| annotation.resources())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: mutable key type [INFO] [stdout] --> src/api/datakey.rs:122:31 [INFO] [stdout] | [INFO] [stdout] 122 | pub fn datasets(&self) -> BTreeSet> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: ... because it contains `ResultItem<'store, AnnotationDataSet>`, which has interior mutability [INFO] [stdout] = note: ... because it contains `&AnnotationDataSet`, which has interior mutability [INFO] [stdout] = note: ... because it contains `AnnotationDataSet`, which has interior mutability [INFO] [stdout] = note: ... because it contains `Arc>`, which has interior mutability [INFO] [stdout] = note: ... because it contains `RwLock`, which has interior mutability [INFO] [stdout] = note: ... because it contains `RwLock`, which has interior mutability [INFO] [stdout] = note: ... because it contains `Atomic`, which has interior mutability [INFO] [stdout] = note: ... because it contains `UnsafeCell<::Storage>`, which has interior mutability [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mutable_key_type [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/datakey.rs:124:14 [INFO] [stdout] | [INFO] [stdout] 124 | .map(|annotation| annotation.datasets().map(|dataset| dataset.clone())) [INFO] [stdout] | ______________^ [INFO] [stdout] 125 | | .flatten() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|annotation| annotation.datasets().map(|dataset| dataset.clone()))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are needlessly cloning iterator elements [INFO] [stdout] --> src/api/datakey.rs:124:52 [INFO] [stdout] | [INFO] [stdout] 124 | .map(|annotation| annotation.datasets().map(|dataset| dataset.clone())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove the `map` call [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/datakey.rs:183:44 [INFO] [stdout] | [INFO] [stdout] 183 | let mut annotations: Vec<_> = self.map(|key| key.annotations()).flatten().collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|key| key.annotations())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/datakey.rs:199:14 [INFO] [stdout] | [INFO] [stdout] 199 | .map(|key| key.annotations_as_metadata()) [INFO] [stdout] | ______________^ [INFO] [stdout] 200 | | .flatten() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|key| key.annotations_as_metadata())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/api/query.rs:216:1 [INFO] [stdout] | [INFO] [stdout] 216 | / impl Default for QueryQualifier { [INFO] [stdout] 217 | | fn default() -> Self { [INFO] [stdout] 218 | | Self::Normal [INFO] [stdout] 219 | | } [INFO] [stdout] 220 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 198 + #[derive(Default)] [INFO] [stdout] 199 | pub enum QueryQualifier { [INFO] [stdout] 200 | /// Normal behaviour, no changes [INFO] [stdout] 201 ~ #[default] [INFO] [stdout] 202 ~ Normal, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/api/query.rs:241:1 [INFO] [stdout] | [INFO] [stdout] 241 | / impl Default for SelectionQualifier { [INFO] [stdout] 242 | | fn default() -> Self { [INFO] [stdout] 243 | | Self::Normal [INFO] [stdout] 244 | | } [INFO] [stdout] 245 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 224 + #[derive(Default)] [INFO] [stdout] 225 | pub enum SelectionQualifier { [INFO] [stdout] 226 | /// Normal behaviour, no changes. [INFO] [stdout] 227 ~ #[default] [INFO] [stdout] 228 ~ Normal, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/api/query.rs:260:1 [INFO] [stdout] | [INFO] [stdout] 260 | / impl Default for AnnotationDepth { [INFO] [stdout] 261 | | fn default() -> Self { [INFO] [stdout] 262 | | Self::One [INFO] [stdout] 263 | | } [INFO] [stdout] 264 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 249 + #[derive(Default)] [INFO] [stdout] 250 | pub enum AnnotationDepth { [INFO] [stdout] 251 | /// Apply only on the same level [INFO] [stdout] ... [INFO] [stdout] 254 | /// Minimal depth corresponds to a different of exactly one layer in the annotation hierarchy formed by AnnotationSelector (above or below) the current one. [INFO] [stdout] 255 ~ #[default] [INFO] [stdout] 256 ~ One, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'b [INFO] [stdout] --> src/api/query.rs:394:21 [INFO] [stdout] | [INFO] [stdout] 394 | fn parse_offset<'b>(mut querystring: &'b str) -> Result<(Option, &'b str), StamError> { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 394 - fn parse_offset<'b>(mut querystring: &'b str) -> Result<(Option, &'b str), StamError> { [INFO] [stdout] 394 + fn parse_offset(mut querystring: &str) -> Result<(Option, &str), StamError> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Result.or_else(|x| Err(y))`, which is more succinctly expressed as `map_err(|x| y)` [INFO] [stdout] --> src/api/query.rs:401:17 [INFO] [stdout] | [INFO] [stdout] 401 | / Cursor::try_from(arg).or_else(|_| { [INFO] [stdout] 402 | | Err(StamError::QuerySyntaxError( [INFO] [stdout] 403 | | format!( [INFO] [stdout] 404 | | "Expected integer for begin cursor after OFFSET, got '{}'", [INFO] [stdout] ... | [INFO] [stdout] 408 | | )) [INFO] [stdout] 409 | | })? [INFO] [stdout] | |__________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] = note: `#[warn(clippy::bind_instead_of_map)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 401 ~ Cursor::try_from(arg).map_err(|_| StamError::QuerySyntaxError( [INFO] [stdout] 402 + format!( [INFO] [stdout] 403 + "Expected integer for begin cursor after OFFSET, got '{}'", [INFO] [stdout] 404 + arg [INFO] [stdout] 405 + ), [INFO] [stdout] 406 + "", [INFO] [stdout] 407 ~ ))? [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Result.or_else(|x| Err(y))`, which is more succinctly expressed as `map_err(|x| y)` [INFO] [stdout] --> src/api/query.rs:417:17 [INFO] [stdout] | [INFO] [stdout] 417 | / Cursor::try_from(arg).or_else(|_| { [INFO] [stdout] 418 | | Err(StamError::QuerySyntaxError( [INFO] [stdout] 419 | | format!( [INFO] [stdout] 420 | | "Expected integer for end cursor, (optional) second parameter after OFFSET, got '{}'", [INFO] [stdout] ... | [INFO] [stdout] 424 | | )) [INFO] [stdout] 425 | | })? [INFO] [stdout] | |__________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 417 ~ Cursor::try_from(arg).map_err(|_| StamError::QuerySyntaxError( [INFO] [stdout] 418 + format!( [INFO] [stdout] 419 + "Expected integer for end cursor, (optional) second parameter after OFFSET, got '{}'", [INFO] [stdout] 420 + arg [INFO] [stdout] 421 + ), [INFO] [stdout] 422 + "", [INFO] [stdout] 423 ~ ))? [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `regex::Error` [INFO] [stdout] --> src/api/query.rs:455:29 [INFO] [stdout] | [INFO] [stdout] 455 | ... err.into(), [INFO] [stdout] | ^^^^^^^^^^ help: consider removing `.into()`: `err` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/api/query.rs:548:40 [INFO] [stdout] | [INFO] [stdout] 548 | Self::DataVariable(&arg[1..], qualifier) [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/api/query.rs:547:17 [INFO] [stdout] | [INFO] [stdout] 547 | if arg.starts_with("?") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] = note: `#[warn(clippy::manual_strip)]` on by default [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 547 ~ if let Some() = arg.strip_prefix("?") { [INFO] [stdout] 548 ~ Self::DataVariable(, qualifier) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/api/query.rs:620:39 [INFO] [stdout] | [INFO] [stdout] 620 | querystring = &remainder[3..]; [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/api/query.rs:619:21 [INFO] [stdout] | [INFO] [stdout] 619 | if remainder.starts_with("OR ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 619 ~ if let Some() = remainder.strip_prefix("OR ") { [INFO] [stdout] 620 ~ querystring = ; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/api/query.rs:623:39 [INFO] [stdout] | [INFO] [stdout] 623 | querystring = &remainder[1..]; [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/api/query.rs:622:28 [INFO] [stdout] | [INFO] [stdout] 622 | } else if remainder.starts_with("]") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 622 ~ } else if let Some() = remainder.strip_prefix("]") { [INFO] [stdout] 623 ~ querystring = ; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/api/query.rs:684:21 [INFO] [stdout] | [INFO] [stdout] 684 | format!("Expected constraint type (DATA, TEXT), got end of string"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Expected constraint type (DATA, TEXT), got end of string".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/query.rs:690:27 [INFO] [stdout] | [INFO] [stdout] 690 | querystring = &querystring[1..].trim_start(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `querystring[1..].trim_start()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/api/query.rs:806:27 [INFO] [stdout] | [INFO] [stdout] 806 | s += &format!("SUBSTORE NONE;"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"SUBSTORE NONE;".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/api/query.rs:843:30 [INFO] [stdout] | [INFO] [stdout] 843 | .map(|s| Cow::Borrowed(s)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Cow::Borrowed` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/api/query.rs:848:38 [INFO] [stdout] | [INFO] [stdout] 848 | ... .map(|s| Cow::Owned(s)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Cow::Owned` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/api/query.rs:916:48 [INFO] [stdout] | [INFO] [stdout] 916 | let id = resource.id().map(|s| Cow::Borrowed(s)).unwrap_or_else(|| { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Cow::Borrowed` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/api/query.rs:920:34 [INFO] [stdout] | [INFO] [stdout] 920 | ... .map(|s| Cow::Owned(s)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Cow::Owned` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/api/query.rs:989:9 [INFO] [stdout] | [INFO] [stdout] 989 | return Some(q); [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 989 - return Some(q); [INFO] [stdout] 989 + Some(q) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this block may be rewritten with the `?` operator [INFO] [stdout] --> src/api/query.rs:979:9 [INFO] [stdout] | [INFO] [stdout] 979 | / if iter.next().is_none() { [INFO] [stdout] 980 | | return None; [INFO] [stdout] 981 | | } [INFO] [stdout] | |_________^ help: replace it with: `iter.next()?;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/api/query.rs:1069:13 [INFO] [stdout] | [INFO] [stdout] 1069 | / if let Some(query) = self.select_by_path(&querypath) { [INFO] [stdout] 1070 | | Some((querypath, query)) [INFO] [stdout] 1071 | | } else { [INFO] [stdout] 1072 | | None [INFO] [stdout] 1073 | | } [INFO] [stdout] | |_____________^ help: try: `self.select_by_path(&querypath).map(|query| (querypath, query))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.iter().nth()` on a `Vec` [INFO] [stdout] --> src/api/query.rs:1106:31 [INFO] [stdout] | [INFO] [stdout] 1106 | if let Some(sq) = q.subqueries.iter().nth(*i) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth [INFO] [stdout] = note: `#[warn(clippy::iter_nth)]` on by default [INFO] [stdout] help: `get` is equivalent but more concise [INFO] [stdout] | [INFO] [stdout] 1106 - if let Some(sq) = q.subqueries.iter().nth(*i) { [INFO] [stdout] 1106 + if let Some(sq) = q.subqueries.get(*i) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/api/query.rs:1197:13 [INFO] [stdout] | [INFO] [stdout] 1197 | / return Err(StamError::QuerySyntaxError( [INFO] [stdout] 1198 | | format!( [INFO] [stdout] 1199 | | "Expected SELECT, ADD or DELETE, got '{}'", [INFO] [stdout] 1200 | | querystring [INFO] [stdout] ... | [INFO] [stdout] 1205 | | "", [INFO] [stdout] 1206 | | )); [INFO] [stdout] | |______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 1197 ~ Err(StamError::QuerySyntaxError( [INFO] [stdout] 1198 + format!( [INFO] [stdout] 1199 + "Expected SELECT, ADD or DELETE, got '{}'", [INFO] [stdout] 1200 + querystring [INFO] [stdout] 1201 + .split(QUERYSPLITCHARS) [INFO] [stdout] 1202 + .next() [INFO] [stdout] 1203 + .unwrap_or("(empty string)"), [INFO] [stdout] 1204 + ), [INFO] [stdout] 1205 + "", [INFO] [stdout] 1206 ~ )) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should use the `starts_with` method [INFO] [stdout] --> src/api/query.rs:1215:15 [INFO] [stdout] | [INFO] [stdout] 1215 | while querystring.chars().next() == Some('@') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `querystring.starts_with('@')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#chars_next_cmp [INFO] [stdout] = note: `#[warn(clippy::chars_next_cmp)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/api/query.rs:1283:21 [INFO] [stdout] | [INFO] [stdout] 1283 | format!("Expected result type (ANNOTATION, DATA, TEXT, KEY, DATASET, RESOURCE), got end of string"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Expected result type (ANNOTATION, DATA, TEXT, KEY, DATASET, RESOURCE), got end of string".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/api/query.rs:1364:21 [INFO] [stdout] | [INFO] [stdout] 1364 | format!("Expected result type ANNOTATION for ADD query got end of string"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Expected result type ANNOTATION for ADD query got end of string".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/api/query.rs:1443:21 [INFO] [stdout] | [INFO] [stdout] 1443 | format!("Expected result type ANNOTATION for DELETE query got end of string"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Expected result type ANNOTATION for DELETE query got end of string".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/query.rs:1497:31 [INFO] [stdout] | [INFO] [stdout] 1497 | querystring = &querystring[1..].trim_start(); //strips the { or | and any spaces [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `querystring[1..].trim_start()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/query.rs:1513:35 [INFO] [stdout] | [INFO] [stdout] 1513 | querystring = &querystring[1..].trim_start(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `querystring[1..].trim_start()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `TextSelection` which implements the `Copy` trait [INFO] [stdout] --> src/api/query.rs:1630:17 [INFO] [stdout] | [INFO] [stdout] 1630 | textselection.inner().clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*textselection.inner()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `TextSelection` which implements the `Copy` trait [INFO] [stdout] --> src/api/query.rs:1643:17 [INFO] [stdout] | [INFO] [stdout] 1643 | textselection.inner().clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*textselection.inner()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/api/query.rs:2024:17 [INFO] [stdout] | [INFO] [stdout] 2024 | format!("AnnotationStore.query() cant not handle mutable queries (ADD/DELETE), expected an immutable one (SELECT)"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"AnnotationStore.query() cant not handle mutable queries (ADD/DELETE), expected an immutable one (SELECT)".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/api/query.rs:2151:37 [INFO] [stdout] | [INFO] [stdout] 2151 | ... format!("ADD query has no TARGET"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"ADD query has no TARGET".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> src/api/query.rs:2155:34 [INFO] [stdout] | [INFO] [stdout] 2155 | ... 1 if complextarget == None => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `complextarget.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] = note: `#[warn(clippy::partialeq_to_none)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/query.rs:2304:34 [INFO] [stdout] | [INFO] [stdout] 2304 | query.select_by_path(&querypath) [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `querypath` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/api/query.rs:2320:17 [INFO] [stdout] | [INFO] [stdout] 2320 | while let Some(constraint) = constraintsiter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for constraint in constraintsiter.by_ref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] = note: `#[warn(clippy::while_let_on_iterator)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/api/query.rs:2328:17 [INFO] [stdout] | [INFO] [stdout] 2328 | while let Some(constraint) = constraintsiter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for constraint in constraintsiter.by_ref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/api/query.rs:2336:17 [INFO] [stdout] | [INFO] [stdout] 2336 | while let Some(constraint) = constraintsiter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for constraint in constraintsiter.by_ref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/api/query.rs:2344:17 [INFO] [stdout] | [INFO] [stdout] 2344 | while let Some(constraint) = constraintsiter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for constraint in constraintsiter.by_ref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/api/query.rs:2353:17 [INFO] [stdout] | [INFO] [stdout] 2353 | while let Some(constraint) = constraintsiter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for constraint in constraintsiter.by_ref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/api/query.rs:2362:17 [INFO] [stdout] | [INFO] [stdout] 2362 | while let Some(constraint) = constraintsiter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for constraint in constraintsiter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `state.iterator` after checking its variant with `is_none` [INFO] [stdout] --> src/api/query.rs:2408:27 [INFO] [stdout] | [INFO] [stdout] 2405 | let got_result = if state.iterator.is_none() { [INFO] [stdout] | --------------------------- help: try: `if let Some() = &mut state.iterator` [INFO] [stdout] ... [INFO] [stdout] 2408 | match state.iterator.as_mut().unwrap() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/query.rs:2603:57 [INFO] [stdout] | [INFO] [stdout] 2603 | Box::new(store.annotations().filter_set(&dataset)) [INFO] [stdout] | ^^^^^^^^ help: change this to: `dataset` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/api/query.rs:2620:18 [INFO] [stdout] | [INFO] [stdout] 2620 | Some(&Constraint::Value(ref operator, _)) => Box::new( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] = note: `#[warn(clippy::needless_borrowed_reference)]` on by default [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 2620 - Some(&Constraint::Value(ref operator, _)) => Box::new( [INFO] [stdout] 2620 + Some(Constraint::Value(operator, _)) => Box::new( [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/api/query.rs:2692:18 [INFO] [stdout] | [INFO] [stdout] 2692 | Some(&Constraint::Union(ref subconstraints)) => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 2692 - Some(&Constraint::Union(ref subconstraints)) => { [INFO] [stdout] 2692 + Some(Constraint::Union(subconstraints)) => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/query.rs:2789:42 [INFO] [stdout] | [INFO] [stdout] 2789 | Box::new(iter.filter_key(&key)) [INFO] [stdout] | ^^^^ help: change this to: `key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/query.rs:2793:48 [INFO] [stdout] | [INFO] [stdout] 2793 | Box::new(iter.filter_key_value(&key, operator.clone())) [INFO] [stdout] | ^^^^ help: change this to: `key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/api/query.rs:2870:13 [INFO] [stdout] | [INFO] [stdout] 2870 | &Constraint::Union(ref subconstraints) => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 2870 - &Constraint::Union(ref subconstraints) => { [INFO] [stdout] 2870 + Constraint::Union(subconstraints) => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/api/query.rs:2906:18 [INFO] [stdout] | [INFO] [stdout] 2906 | Some(&Constraint::Data(ref handles, _)) => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 2906 - Some(&Constraint::Data(ref handles, _)) => { [INFO] [stdout] 2906 + Some(Constraint::Data(handles, _)) => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/api/query.rs:2976:18 [INFO] [stdout] | [INFO] [stdout] 2976 | Some(&Constraint::Union(ref subconstraints)) => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 2976 - Some(&Constraint::Union(ref subconstraints)) => { [INFO] [stdout] 2976 + Some(Constraint::Union(subconstraints)) => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/query.rs:3024:42 [INFO] [stdout] | [INFO] [stdout] 3024 | Box::new(iter.filter_key(&key)) [INFO] [stdout] | ^^^^ help: change this to: `key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/query.rs:3028:42 [INFO] [stdout] | [INFO] [stdout] 3028 | Box::new(iter.filter_key(&key).filter_value(operator.clone())) [INFO] [stdout] | ^^^^ help: change this to: `key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/api/query.rs:3034:13 [INFO] [stdout] | [INFO] [stdout] 3034 | &Constraint::Union(ref subconstraints) => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 3034 - &Constraint::Union(ref subconstraints) => { [INFO] [stdout] 3034 + Constraint::Union(subconstraints) => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/api/query.rs:3077:18 [INFO] [stdout] | [INFO] [stdout] 3077 | Some(&Constraint::Keys(ref handles, _)) => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 3077 - Some(&Constraint::Keys(ref handles, _)) => { [INFO] [stdout] 3077 + Some(Constraint::Keys(handles, _)) => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/api/query.rs:3105:18 [INFO] [stdout] | [INFO] [stdout] 3105 | Some(&Constraint::Union(ref subconstraints)) => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 3105 - Some(&Constraint::Union(ref subconstraints)) => { [INFO] [stdout] 3105 + Some(Constraint::Union(subconstraints)) => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/api/query.rs:3136:13 [INFO] [stdout] | [INFO] [stdout] 3136 | &Constraint::Union(ref subconstraints) => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 3136 - &Constraint::Union(ref subconstraints) => { [INFO] [stdout] 3136 + Constraint::Union(subconstraints) => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/api/query.rs:3180:18 [INFO] [stdout] | [INFO] [stdout] 3180 | Some(&Constraint::Union(ref subconstraints)) => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 3180 - Some(&Constraint::Union(ref subconstraints)) => { [INFO] [stdout] 3180 + Some(Constraint::Union(subconstraints)) => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/api/query.rs:3223:13 [INFO] [stdout] | [INFO] [stdout] 3223 | &Constraint::Union(ref subconstraints) => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 3223 - &Constraint::Union(ref subconstraints) => { [INFO] [stdout] 3223 + Constraint::Union(subconstraints) => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/api/query.rs:3263:18 [INFO] [stdout] | [INFO] [stdout] 3263 | Some(&Constraint::TextSelections(ref handles, _)) => Box::new( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 3263 - Some(&Constraint::TextSelections(ref handles, _)) => Box::new( [INFO] [stdout] 3263 + Some(Constraint::TextSelections(handles, _)) => Box::new( [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/api/query.rs:3270:18 [INFO] [stdout] | [INFO] [stdout] 3270 | Some(&Constraint::Annotations(ref handles, _, _)) => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 3270 - Some(&Constraint::Annotations(ref handles, _, _)) => { [INFO] [stdout] 3270 + Some(Constraint::Annotations(handles, _, _)) => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/query.rs:3280:36 [INFO] [stdout] | [INFO] [stdout] 3280 | .textselection(&offset) [INFO] [stdout] | ^^^^^^^ help: change this to: `offset` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/api/query.rs:3376:18 [INFO] [stdout] | [INFO] [stdout] 3376 | Some(&Constraint::Value(ref operator, _)) => Box::new( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 3376 - Some(&Constraint::Value(ref operator, _)) => Box::new( [INFO] [stdout] 3376 + Some(Constraint::Value(operator, _)) => Box::new( [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/query.rs:3428:47 [INFO] [stdout] | [INFO] [stdout] 3428 | Box::new(iter.filter_resource(&resource)) [INFO] [stdout] | ^^^^^^^^^ help: change this to: `resource` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/query.rs:3449:42 [INFO] [stdout] | [INFO] [stdout] 3449 | Box::new(iter.filter_key(&key)) [INFO] [stdout] | ^^^^ help: change this to: `key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/query.rs:3453:48 [INFO] [stdout] | [INFO] [stdout] 3453 | Box::new(iter.filter_key_value(&key, operator.clone())) [INFO] [stdout] | ^^^^ help: change this to: `key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/query.rs:3457:53 [INFO] [stdout] | [INFO] [stdout] 3457 | Box::new(iter.filter_annotationdata(&data)) [INFO] [stdout] | ^^^^^ help: change this to: `data` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/api/query.rs:3459:13 [INFO] [stdout] | [INFO] [stdout] 3459 | &Constraint::Value(ref operator, _) => Box::new(iter.filter_value(operator.clone())), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 3459 - &Constraint::Value(ref operator, _) => Box::new(iter.filter_value(operator.clone())), [INFO] [stdout] 3459 + Constraint::Value(operator, _) => Box::new(iter.filter_value(operator.clone())), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for cloning elements [INFO] [stdout] --> src/api/query.rs:3472:49 [INFO] [stdout] | [INFO] [stdout] 3472 | ... .filter_map(|x| x.as_resultitem().map(|x| x.clone())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `cloned` method: `x.as_resultitem().cloned()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for cloning elements [INFO] [stdout] --> src/api/query.rs:3482:49 [INFO] [stdout] | [INFO] [stdout] 3482 | ... .filter_map(|x| x.as_resultitem().map(|x| x.clone())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `cloned` method: `x.as_resultitem().cloned()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/api/query.rs:3517:18 [INFO] [stdout] | [INFO] [stdout] 3517 | Some(&Constraint::Resources(ref handles, _)) => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 3517 - Some(&Constraint::Resources(ref handles, _)) => { [INFO] [stdout] 3517 + Some(Constraint::Resources(handles, _)) => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/api/query.rs:3628:18 [INFO] [stdout] | [INFO] [stdout] 3628 | Some(&Constraint::Union(ref subconstraints)) => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 3628 - Some(&Constraint::Union(ref subconstraints)) => { [INFO] [stdout] 3628 + Some(Constraint::Union(subconstraints)) => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/query.rs:3679:54 [INFO] [stdout] | [INFO] [stdout] 3679 | Box::new(iter.filter_key_in_metadata(&key)) [INFO] [stdout] | ^^^^ help: change this to: `key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/query.rs:3683:50 [INFO] [stdout] | [INFO] [stdout] 3683 | Box::new(iter.filter_key_on_text(&key)) [INFO] [stdout] | ^^^^ help: change this to: `key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/query.rs:3687:65 [INFO] [stdout] | [INFO] [stdout] 3687 | Box::new(iter.filter_annotationdata_in_metadata(&data)) [INFO] [stdout] | ^^^^^ help: change this to: `data` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/query.rs:3691:61 [INFO] [stdout] | [INFO] [stdout] 3691 | Box::new(iter.filter_annotationdata_on_text(&data)) [INFO] [stdout] | ^^^^^ help: change this to: `data` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/query.rs:3704:56 [INFO] [stdout] | [INFO] [stdout] 3704 | Box::new(iter.filter_key_value_on_text(&key, operator.clone())) [INFO] [stdout] | ^^^^ help: change this to: `key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/query.rs:3708:60 [INFO] [stdout] | [INFO] [stdout] 3708 | Box::new(iter.filter_key_value_in_metadata(&key, operator.clone())) [INFO] [stdout] | ^^^^ help: change this to: `key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/api/query.rs:3710:13 [INFO] [stdout] | [INFO] [stdout] 3710 | &Constraint::Union(ref subconstraints) => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 3710 - &Constraint::Union(ref subconstraints) => { [INFO] [stdout] 3710 + Constraint::Union(subconstraints) => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/api/query.rs:3795:9 [INFO] [stdout] | [INFO] [stdout] 3795 | / return Err(StamError::VariableNotFoundError( [INFO] [stdout] 3796 | | name.into(), [INFO] [stdout] 3797 | | Some(Type::AnnotationData), [INFO] [stdout] 3798 | | "resolve_datavar", [INFO] [stdout] 3799 | | )); [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 3795 ~ Err(StamError::VariableNotFoundError( [INFO] [stdout] 3796 + name.into(), [INFO] [stdout] 3797 + Some(Type::AnnotationData), [INFO] [stdout] 3798 + "resolve_datavar", [INFO] [stdout] 3799 ~ )) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/api/query.rs:3826:9 [INFO] [stdout] | [INFO] [stdout] 3826 | / return Err(StamError::VariableNotFoundError( [INFO] [stdout] 3827 | | name.into(), [INFO] [stdout] 3828 | | Some(Type::DataKey), [INFO] [stdout] 3829 | | "resolve_keyvar", [INFO] [stdout] 3830 | | )); [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 3826 ~ Err(StamError::VariableNotFoundError( [INFO] [stdout] 3827 + name.into(), [INFO] [stdout] 3828 + Some(Type::DataKey), [INFO] [stdout] 3829 + "resolve_keyvar", [INFO] [stdout] 3830 ~ )) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/api/query.rs:3860:9 [INFO] [stdout] | [INFO] [stdout] 3860 | / return Err(StamError::VariableNotFoundError( [INFO] [stdout] 3861 | | name.into(), [INFO] [stdout] 3862 | | Some(Type::AnnotationDataSet), [INFO] [stdout] 3863 | | "resolve_datasetvar", [INFO] [stdout] 3864 | | )); [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 3860 ~ Err(StamError::VariableNotFoundError( [INFO] [stdout] 3861 + name.into(), [INFO] [stdout] 3862 + Some(Type::AnnotationDataSet), [INFO] [stdout] 3863 + "resolve_datasetvar", [INFO] [stdout] 3864 ~ )) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/api/query.rs:3894:9 [INFO] [stdout] | [INFO] [stdout] 3894 | / return Err(StamError::VariableNotFoundError( [INFO] [stdout] 3895 | | name.into(), [INFO] [stdout] 3896 | | Some(Type::Annotation), [INFO] [stdout] 3897 | | "resolve_annotationvar", [INFO] [stdout] 3898 | | )); [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 3894 ~ Err(StamError::VariableNotFoundError( [INFO] [stdout] 3895 + name.into(), [INFO] [stdout] 3896 + Some(Type::Annotation), [INFO] [stdout] 3897 + "resolve_annotationvar", [INFO] [stdout] 3898 ~ )) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/api/query.rs:3925:9 [INFO] [stdout] | [INFO] [stdout] 3925 | / return Err(StamError::VariableNotFoundError( [INFO] [stdout] 3926 | | name.into(), [INFO] [stdout] 3927 | | Some(Type::TextSelection), [INFO] [stdout] 3928 | | "resolve_textvar", [INFO] [stdout] 3929 | | )); [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 3925 ~ Err(StamError::VariableNotFoundError( [INFO] [stdout] 3926 + name.into(), [INFO] [stdout] 3927 + Some(Type::TextSelection), [INFO] [stdout] 3928 + "resolve_textvar", [INFO] [stdout] 3929 ~ )) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/api/query.rs:3959:9 [INFO] [stdout] | [INFO] [stdout] 3959 | / return Err(StamError::VariableNotFoundError( [INFO] [stdout] 3960 | | name.into(), [INFO] [stdout] 3961 | | Some(Type::TextResource), [INFO] [stdout] 3962 | | "resolve_resourcevar", [INFO] [stdout] 3963 | | )); [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 3959 ~ Err(StamError::VariableNotFoundError( [INFO] [stdout] 3960 + name.into(), [INFO] [stdout] 3961 + Some(Type::TextResource), [INFO] [stdout] 3962 + "resolve_resourcevar", [INFO] [stdout] 3963 ~ )) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/api/query.rs:3993:9 [INFO] [stdout] | [INFO] [stdout] 3993 | / return Err(StamError::VariableNotFoundError( [INFO] [stdout] 3994 | | name.into(), [INFO] [stdout] 3995 | | Some(Type::AnnotationSubStore), [INFO] [stdout] 3996 | | "Variable of type SUBSTORE not found", [INFO] [stdout] 3997 | | )); [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 3993 ~ Err(StamError::VariableNotFoundError( [INFO] [stdout] 3994 + name.into(), [INFO] [stdout] 3995 + Some(Type::AnnotationSubStore), [INFO] [stdout] 3996 + "Variable of type SUBSTORE not found", [INFO] [stdout] 3997 ~ )) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'q [INFO] [stdout] --> src/api/query.rs:4090:13 [INFO] [stdout] | [INFO] [stdout] 4090 | fn next<'q>(&'q mut self) -> Option { [INFO] [stdout] | ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 4090 - fn next<'q>(&'q mut self) -> Option { [INFO] [stdout] 4090 + fn next(&mut self) -> Option { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/api/query.rs:4132:9 [INFO] [stdout] | [INFO] [stdout] 4132 | return Some(result); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 4132 - return Some(result); [INFO] [stdout] 4132 + Some(result) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `QueryResultItems` has a public `len` method, but no `is_empty` method [INFO] [stdout] --> src/api/query.rs:4142:5 [INFO] [stdout] | [INFO] [stdout] 4142 | pub fn len(&self) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_without_is_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/api/query.rs:4247:9 [INFO] [stdout] | [INFO] [stdout] 4247 | / if !c.is_ascii_digit() { [INFO] [stdout] 4248 | | if c != '-' || prevc != None { [INFO] [stdout] 4249 | | numeric = false; [INFO] [stdout] 4250 | | } [INFO] [stdout] 4251 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 4247 ~ if !c.is_ascii_digit() [INFO] [stdout] 4248 ~ && (c != '-' || prevc != None) { [INFO] [stdout] 4249 | numeric = false; [INFO] [stdout] 4250 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> src/api/query.rs:4248:28 [INFO] [stdout] | [INFO] [stdout] 4248 | if c != '-' || prevc != None { [INFO] [stdout] | ^^^^^^^^^^^^^ help: use `Option::is_some()` instead: `prevc.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/query.rs:4272:49 [INFO] [stdout] | [INFO] [stdout] 4272 | if DateTime::parse_from_rfc3339(&s).is_ok() { [INFO] [stdout] | ^^ help: change this to: `s` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/api/query.rs:4283:12 [INFO] [stdout] | [INFO] [stdout] 4283 | fn get_arg<'a>(querystring: &'a str) -> Result<(&'a str, &'a str, ArgType), StamError> { [INFO] [stdout] | ^^ ^^ ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 4283 - fn get_arg<'a>(querystring: &'a str) -> Result<(&'a str, &'a str, ArgType), StamError> { [INFO] [stdout] 4283 + fn get_arg(querystring: &str) -> Result<(&str, &str, ArgType), StamError> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/api/query.rs:4314:5 [INFO] [stdout] | [INFO] [stdout] 4314 | / return Err(StamError::QuerySyntaxError( [INFO] [stdout] 4315 | | format!( [INFO] [stdout] 4316 | | "Failed to parse argument '{}'. Missing semicolon perhaps?", [INFO] [stdout] 4317 | | querystring [INFO] [stdout] 4318 | | ), [INFO] [stdout] 4319 | | "", [INFO] [stdout] 4320 | | )); [INFO] [stdout] | |______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 4314 ~ Err(StamError::QuerySyntaxError( [INFO] [stdout] 4315 + format!( [INFO] [stdout] 4316 + "Failed to parse argument '{}'. Missing semicolon perhaps?", [INFO] [stdout] 4317 + querystring [INFO] [stdout] 4318 + ), [INFO] [stdout] 4319 + "", [INFO] [stdout] 4320 ~ )) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/query.rs:4294:31 [INFO] [stdout] | [INFO] [stdout] 4294 | return Ok((s, &querystring[i + 1..].trim_start(), get_arg_type(s, true))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `querystring[i + 1..].trim_start()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/query.rs:4301:17 [INFO] [stdout] | [INFO] [stdout] 4301 | &querystring[i + 1..].trim_start(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `querystring[i + 1..].trim_start()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/query.rs:4308:17 [INFO] [stdout] | [INFO] [stdout] 4308 | &querystring[i..].trim_start(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `querystring[i..].trim_start()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Result.or_else(|x| Err(y))`, which is more succinctly expressed as `map_err(|x| y)` [INFO] [stdout] --> src/api/query.rs:4589:45 [INFO] [stdout] | [INFO] [stdout] 4589 | ArgType::Integer => DataValue::try_from(value).or_else(|_| { [INFO] [stdout] | _____________________________________________^ [INFO] [stdout] 4590 | | Err(StamError::QuerySyntaxError( [INFO] [stdout] 4591 | | format!("Expected integer in assignment, got '{}'", value), [INFO] [stdout] 4592 | | "", [INFO] [stdout] 4593 | | )) [INFO] [stdout] 4594 | | })?, [INFO] [stdout] | |__________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 4589 ~ ArgType::Integer => DataValue::try_from(value).map_err(|_| StamError::QuerySyntaxError( [INFO] [stdout] 4590 + format!("Expected integer in assignment, got '{}'", value), [INFO] [stdout] 4591 + "", [INFO] [stdout] 4592 ~ ))?, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of a fallible conversion when an infallible one could be used [INFO] [stdout] --> src/api/query.rs:4589:45 [INFO] [stdout] | [INFO] [stdout] 4589 | ArgType::Integer => DataValue::try_from(value).or_else(|_| { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: converting `&str` to `DataValue` cannot fail [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fallible_conversions [INFO] [stdout] = note: `#[warn(clippy::unnecessary_fallible_conversions)]` on by default [INFO] [stdout] help: use [INFO] [stdout] | [INFO] [stdout] 4589 - ArgType::Integer => DataValue::try_from(value).or_else(|_| { [INFO] [stdout] 4589 + ArgType::Integer => From::from(value).or_else(|_| { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Result.or_else(|x| Err(y))`, which is more succinctly expressed as `map_err(|x| y)` [INFO] [stdout] --> src/api/query.rs:4595:43 [INFO] [stdout] | [INFO] [stdout] 4595 | ArgType::Float => DataValue::try_from(value).or_else(|_| { [INFO] [stdout] | ___________________________________________^ [INFO] [stdout] 4596 | | Err(StamError::QuerySyntaxError( [INFO] [stdout] 4597 | | format!("Expected integer in assignment, got '{}'", value), [INFO] [stdout] 4598 | | "", [INFO] [stdout] 4599 | | )) [INFO] [stdout] 4600 | | })?, [INFO] [stdout] | |__________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 4595 ~ ArgType::Float => DataValue::try_from(value).map_err(|_| StamError::QuerySyntaxError( [INFO] [stdout] 4596 + format!("Expected integer in assignment, got '{}'", value), [INFO] [stdout] 4597 + "", [INFO] [stdout] 4598 ~ ))?, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of a fallible conversion when an infallible one could be used [INFO] [stdout] --> src/api/query.rs:4595:43 [INFO] [stdout] | [INFO] [stdout] 4595 | ArgType::Float => DataValue::try_from(value).or_else(|_| { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: converting `&str` to `DataValue` cannot fail [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fallible_conversions [INFO] [stdout] help: use [INFO] [stdout] | [INFO] [stdout] 4595 - ArgType::Float => DataValue::try_from(value).or_else(|_| { [INFO] [stdout] 4595 + ArgType::Float => From::from(value).or_else(|_| { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/api/query.rs:4615:25 [INFO] [stdout] | [INFO] [stdout] 4615 | format!("Expected name for TARGET"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Expected name for TARGET".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/api/query.rs:4640:21 [INFO] [stdout] | [INFO] [stdout] 4640 | format!("Expected assignment type (DATA, ID, TARGET), got end of string"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Expected assignment type (DATA, ID, TARGET), got end of string".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/query.rs:4646:27 [INFO] [stdout] | [INFO] [stdout] 4646 | querystring = &querystring[1..].trim_start(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `querystring[1..].trim_start()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'b [INFO] [stdout] --> src/api/query.rs:4676:21 [INFO] [stdout] | [INFO] [stdout] 4676 | fn parse_offset<'b>(mut querystring: &'b str) -> Result<(Option, &'b str), StamError> { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 4676 - fn parse_offset<'b>(mut querystring: &'b str) -> Result<(Option, &'b str), StamError> { [INFO] [stdout] 4676 + fn parse_offset(mut querystring: &str) -> Result<(Option, &str), StamError> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Result.or_else(|x| Err(y))`, which is more succinctly expressed as `map_err(|x| y)` [INFO] [stdout] --> src/api/query.rs:4683:17 [INFO] [stdout] | [INFO] [stdout] 4683 | / Cursor::try_from(arg).or_else(|_| { [INFO] [stdout] 4684 | | Err(StamError::QuerySyntaxError( [INFO] [stdout] 4685 | | format!( [INFO] [stdout] 4686 | | "Expected integer for begin cursor after OFFSET, got '{}'", [INFO] [stdout] ... | [INFO] [stdout] 4690 | | )) [INFO] [stdout] 4691 | | })? [INFO] [stdout] | |__________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 4683 ~ Cursor::try_from(arg).map_err(|_| StamError::QuerySyntaxError( [INFO] [stdout] 4684 + format!( [INFO] [stdout] 4685 + "Expected integer for begin cursor after OFFSET, got '{}'", [INFO] [stdout] 4686 + arg [INFO] [stdout] 4687 + ), [INFO] [stdout] 4688 + "", [INFO] [stdout] 4689 ~ ))? [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Result.or_else(|x| Err(y))`, which is more succinctly expressed as `map_err(|x| y)` [INFO] [stdout] --> src/api/query.rs:4699:17 [INFO] [stdout] | [INFO] [stdout] 4699 | / Cursor::try_from(arg).or_else(|_| { [INFO] [stdout] 4700 | | Err(StamError::QuerySyntaxError( [INFO] [stdout] 4701 | | format!( [INFO] [stdout] 4702 | | "Expected integer for end cursor, (optional) second parameter after OFFSET, got '{}'", [INFO] [stdout] ... | [INFO] [stdout] 4706 | | )) [INFO] [stdout] 4707 | | })? [INFO] [stdout] | |__________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 4699 ~ Cursor::try_from(arg).map_err(|_| StamError::QuerySyntaxError( [INFO] [stdout] 4700 + format!( [INFO] [stdout] 4701 + "Expected integer for end cursor, (optional) second parameter after OFFSET, got '{}'", [INFO] [stdout] 4702 + arg [INFO] [stdout] 4703 + ), [INFO] [stdout] 4704 + "", [INFO] [stdout] 4705 ~ ))? [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/resources.rs:240:14 [INFO] [stdout] | [INFO] [stdout] 240 | .map(|resource| resource.annotations_as_metadata()) [INFO] [stdout] | ______________^ [INFO] [stdout] 241 | | .flatten() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|resource| resource.annotations_as_metadata())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/resources.rs:257:14 [INFO] [stdout] | [INFO] [stdout] 257 | .map(|resource| resource.annotations()) [INFO] [stdout] | ______________^ [INFO] [stdout] 258 | | .flatten() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|resource| resource.annotations())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/resources.rs:270:14 [INFO] [stdout] | [INFO] [stdout] 270 | .map(|resource| resource.textselections()) [INFO] [stdout] | ______________^ [INFO] [stdout] 271 | | .flatten() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|resource| resource.textselections())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/text.rs:517:43 [INFO] [stdout] | [INFO] [stdout] 517 | let offset = self.absolute_offset(&offset)?; //turns the relative offset into an absolute one (i.e. offsets in TextResource) [INFO] [stdout] | ^^^^^^^ help: change this to: `offset` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/text.rs:708:43 [INFO] [stdout] | [INFO] [stdout] 708 | let offset = self.absolute_offset(&offset)?; //turns the relative offset into an absolute one (i.e. offsets in TextResource) [INFO] [stdout] | ^^^^^^^ help: change this to: `offset` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a, 'b [INFO] [stdout] --> src/api/text.rs:768:50 [INFO] [stdout] | [INFO] [stdout] 768 | pub(crate) fn find_text_regex_select_expressions<'a, 'b>( [INFO] [stdout] | ^^ ^^ [INFO] [stdout] 769 | text: &'a str, [INFO] [stdout] | ^^ [INFO] [stdout] 770 | expressions: &'b [Regex], [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 768 ~ pub(crate) fn find_text_regex_select_expressions( [INFO] [stdout] 769 ~ text: &str, [INFO] [stdout] 770 ~ expressions: &[Regex], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Some` variant of the iterator element is used [INFO] [stdout] --> src/api/text.rs:816:17 [INFO] [stdout] | [INFO] [stdout] 816 | / for group in m.iter() { [INFO] [stdout] 817 | | if let Some(group) = group { [INFO] [stdout] 818 | | if begin.is_none() || begin.unwrap() < group.start() { [INFO] [stdout] 819 | | begin = Some(group.start()); [INFO] [stdout] ... | [INFO] [stdout] 822 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/api/text.rs:817:21 [INFO] [stdout] | [INFO] [stdout] 817 | / if let Some(group) = group { [INFO] [stdout] 818 | | if begin.is_none() || begin.unwrap() < group.start() { [INFO] [stdout] 819 | | begin = Some(group.start()); [INFO] [stdout] 820 | | } [INFO] [stdout] 821 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 816 ~ for group in m.iter().flatten() { [INFO] [stdout] 817 + if begin.is_none() || begin.unwrap() < group.start() { [INFO] [stdout] 818 + begin = Some(group.start()); [INFO] [stdout] 819 + } [INFO] [stdout] 820 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Some` variant of the iterator element is used [INFO] [stdout] --> src/api/text.rs:834:17 [INFO] [stdout] | [INFO] [stdout] 834 | / for group in m.iter() { [INFO] [stdout] 835 | | if let Some(group) = group { [INFO] [stdout] 836 | | if end.is_none() || end.unwrap() < group.start() { [INFO] [stdout] 837 | | end = Some(group.start()); [INFO] [stdout] ... | [INFO] [stdout] 840 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/api/text.rs:835:21 [INFO] [stdout] | [INFO] [stdout] 835 | / if let Some(group) = group { [INFO] [stdout] 836 | | if end.is_none() || end.unwrap() < group.start() { [INFO] [stdout] 837 | | end = Some(group.start()); [INFO] [stdout] 838 | | } [INFO] [stdout] 839 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 834 ~ for group in m.iter().flatten() { [INFO] [stdout] 835 + if end.is_none() || end.unwrap() < group.start() { [INFO] [stdout] 836 + end = Some(group.start()); [INFO] [stdout] 837 + } [INFO] [stdout] 838 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/api/text.rs:853:17 [INFO] [stdout] | [INFO] [stdout] 853 | / if let Some(m) = iter.next() { [INFO] [stdout] 854 | | Some(Match::NoCapture(m)) [INFO] [stdout] 855 | | } else { [INFO] [stdout] 856 | | None [INFO] [stdout] 857 | | } [INFO] [stdout] | |_________________^ help: try: `iter.next().map(Match::NoCapture)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/api/text.rs:860:17 [INFO] [stdout] | [INFO] [stdout] 860 | / if let Some(m) = iter.next() { [INFO] [stdout] 861 | | Some(Match::WithCapture(m)) [INFO] [stdout] 862 | | } else { [INFO] [stdout] 863 | | None [INFO] [stdout] 864 | | } [INFO] [stdout] | |_________________^ help: try: `iter.next().map(Match::WithCapture)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/api/text.rs:988:21 [INFO] [stdout] | [INFO] [stdout] 988 | / if j != i && m2.is_some() { [INFO] [stdout] 989 | | if m2.as_ref().unwrap().begin() >= m.begin() [INFO] [stdout] 990 | | && m2.as_ref().unwrap().begin() < m.end() [INFO] [stdout] ... | [INFO] [stdout] 995 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 988 ~ if j != i && m2.is_some() [INFO] [stdout] 989 ~ && m2.as_ref().unwrap().begin() >= m.begin() [INFO] [stdout] 990 | && m2.as_ref().unwrap().begin() < m.end() [INFO] [stdout] ... [INFO] [stdout] 993 | *m2 = self.matchiters[j].next(); [INFO] [stdout] 994 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/api/text.rs:1102:17 [INFO] [stdout] | [INFO] [stdout] 1102 | if let Some(text) = resource.text_by_offset(&self.offset).ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] help: consider matching on `Ok(text)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 1102 - if let Some(text) = resource.text_by_offset(&self.offset).ok() { [INFO] [stdout] 1102 + if let Ok(text) = resource.text_by_offset(&self.offset) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/api/text.rs:1161:17 [INFO] [stdout] | [INFO] [stdout] 1161 | if let Some(text) = resource.text_by_offset(&self.offset).ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] help: consider matching on `Ok(text)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 1161 - if let Some(text) = resource.text_by_offset(&self.offset).ok() { [INFO] [stdout] 1161 + if let Ok(text) = resource.text_by_offset(&self.offset) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/textselection.rs:178:46 [INFO] [stdout] | [INFO] [stdout] 178 | Self::Unbound(_, _, item) => &item, [INFO] [stdout] | ^^^^^ help: change this to: `item` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/textselection.rs:192:42 [INFO] [stdout] | [INFO] [stdout] 192 | Self::Unbound(_, _, item) => &item, [INFO] [stdout] | ^^^^^ help: change this to: `item` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/textselection.rs:211:42 [INFO] [stdout] | [INFO] [stdout] 211 | Self::Unbound(_, _, item) => &item, [INFO] [stdout] | ^^^^^ help: change this to: `item` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `textselection::TextSelection` [INFO] [stdout] --> src/api/textselection.rs:296:34 [INFO] [stdout] | [INFO] [stdout] 296 | Self::Bound(item) => item.as_ref().clone().into(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `item.as_ref().clone()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `TextSelection` which implements the `Copy` trait [INFO] [stdout] --> src/api/textselection.rs:296:34 [INFO] [stdout] | [INFO] [stdout] 296 | Self::Bound(item) => item.as_ref().clone().into(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `(*item.as_ref())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `TextSelection` which implements the `Copy` trait [INFO] [stdout] --> src/api/textselection.rs:297:51 [INFO] [stdout] | [INFO] [stdout] 297 | Self::Unbound(_, _, textselection) => textselection.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*textselection` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the impl [INFO] [stdout] --> src/api/textselection.rs:527:6 [INFO] [stdout] | [INFO] [stdout] 527 | impl<'store, I> SortTextualOrder for I [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the impl [INFO] [stdout] --> src/api/textselection.rs:549:6 [INFO] [stdout] | [INFO] [stdout] 549 | impl<'store, I> SortTextualOrder for I [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_unstable` [INFO] [stdout] --> src/api/textselection.rs:555:9 [INFO] [stdout] | [INFO] [stdout] 555 | v.sort_unstable_by(|a, b| a.cmp(b)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] = note: `#[warn(clippy::unnecessary_sort_by)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 555 - v.sort_unstable_by(|a, b| a.cmp(b)); [INFO] [stdout] 555 + v.sort_unstable(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/api/textselection.rs:624:18 [INFO] [stdout] | [INFO] [stdout] 624 | .map(|textselection| ResultTextSelection::Bound(textselection)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `ResultTextSelection::Bound` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/api/textselection.rs:636:18 [INFO] [stdout] | [INFO] [stdout] 636 | .map(|textselection| ResultTextSelection::Bound(textselection)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `ResultTextSelection::Bound` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/textselection.rs:661:14 [INFO] [stdout] | [INFO] [stdout] 661 | .map(|resource| resource.annotations()) [INFO] [stdout] | ______________^ [INFO] [stdout] 662 | | .flatten() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|resource| resource.annotations())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/api/textselection.rs:708:13 [INFO] [stdout] | [INFO] [stdout] 708 | return text; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 708 - return text; [INFO] [stdout] 708 + text [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_none()` [INFO] [stdout] --> src/api/textselection.rs:707:16 [INFO] [stdout] | [INFO] [stdout] 707 | if let None = iter.next() { [INFO] [stdout] | -------^^^^-------------- help: try: `if iter.next().is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/api/textselection.rs:1004:17 [INFO] [stdout] | [INFO] [stdout] 1004 | / if let Some(handle) = item.handle() { [INFO] [stdout] 1005 | | Some((item.resource().handle(), handle)) [INFO] [stdout] 1006 | | } else { [INFO] [stdout] 1007 | | None [INFO] [stdout] 1008 | | } [INFO] [stdout] | |_________________^ help: try: `item.handle().map(|handle| (item.resource().handle(), handle))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `foundresource` after checking its variant with `is_some` [INFO] [stdout] --> src/api/textselection.rs:1190:24 [INFO] [stdout] | [INFO] [stdout] 1189 | if foundresource.is_some() { [INFO] [stdout] | -------------------------- help: try: `if let Some() = foundresource` [INFO] [stdout] 1190 | if foundresource.unwrap() == tsel.resource().handle() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/api/webanno.rs:63:9 [INFO] [stdout] | [INFO] [stdout] 63 | / match scheme { [INFO] [stdout] 64 | | "http" | "https" | "urn" | "file" | "_" => true, [INFO] [stdout] 65 | | _ => false, [INFO] [stdout] 66 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] = note: `#[warn(clippy::match_like_matches_macro)]` on by default [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 63 - match scheme { [INFO] [stdout] 64 - "http" | "https" | "urn" | "file" | "_" => true, [INFO] [stdout] 65 - _ => false, [INFO] [stdout] 66 - } [INFO] [stdout] 63 + matches!(scheme, "http" | "https" | "urn" | "file" | "_") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/api/webanno.rs:202:17 [INFO] [stdout] | [INFO] [stdout] 202 | / if (dataset_id.ends_with(".jsonld") || dataset_id.ends_with(".json")) [INFO] [stdout] 203 | | && is_iri(dataset_id) [INFO] [stdout] 204 | | { [INFO] [stdout] 205 | | if self.extra_context.iter().all(|x| x != dataset_id) { [INFO] [stdout] ... | [INFO] [stdout] 208 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 203 ~ && is_iri(dataset_id) [INFO] [stdout] 204 ~ && self.extra_context.iter().all(|x| x != dataset_id) { [INFO] [stdout] 205 | self.extra_context.push(dataset_id.to_string()); [INFO] [stdout] 206 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/api/webanno.rs:642:29 [INFO] [stdout] | [INFO] [stdout] 642 | ann_out += &format!( [INFO] [stdout] | _____________________________^ [INFO] [stdout] 643 | | "{}", [INFO] [stdout] 644 | | &output_selector(selector, store, config, true, need_second_pass, second_pass) [INFO] [stdout] 645 | | ); [INFO] [stdout] | |_________________^ help: consider using `.to_string()`: `(&output_selector(selector, store, config, true, need_second_pass, second_pass)).to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/api/webanno.rs:655:29 [INFO] [stdout] | [INFO] [stdout] 655 | ann_out += &format!( [INFO] [stdout] | _____________________________^ [INFO] [stdout] 656 | | "{}", [INFO] [stdout] 657 | | &output_selector(selector, store, config, true, need_second_pass, second_pass) [INFO] [stdout] 658 | | ); [INFO] [stdout] | |_________________^ help: consider using `.to_string()`: `(&output_selector(selector, store, config, true, need_second_pass, second_pass)).to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/api/webanno.rs:668:29 [INFO] [stdout] | [INFO] [stdout] 668 | ann_out += &format!( [INFO] [stdout] | _____________________________^ [INFO] [stdout] 669 | | "{}", [INFO] [stdout] 670 | | &output_selector(selector, store, config, true, need_second_pass, second_pass) [INFO] [stdout] 671 | | ); [INFO] [stdout] | |_________________^ help: consider using `.to_string()`: `(&output_selector(selector, store, config, true, need_second_pass, second_pass)).to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/api/webanno.rs:689:33 [INFO] [stdout] | [INFO] [stdout] 689 | ann_out += &format!( [INFO] [stdout] | _________________________________^ [INFO] [stdout] 690 | | "{}", [INFO] [stdout] 691 | | &output_selector( [INFO] [stdout] 692 | | &subselector, [INFO] [stdout] ... | [INFO] [stdout] 699 | | ); [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] help: consider using `.to_string()` [INFO] [stdout] | [INFO] [stdout] 689 ~ ann_out += &(&output_selector( [INFO] [stdout] 690 + &subselector, [INFO] [stdout] 691 + store, [INFO] [stdout] 692 + config, [INFO] [stdout] 693 + true, [INFO] [stdout] 694 + need_second_pass, [INFO] [stdout] 695 + second_pass [INFO] [stdout] 696 ~ )).to_string(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/webanno.rs:692:29 [INFO] [stdout] | [INFO] [stdout] 692 | ... &subselector, [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `subselector` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/api/transpose.rs:60:1 [INFO] [stdout] | [INFO] [stdout] 60 | / impl Default for TranspositionSide { [INFO] [stdout] 61 | | fn default() -> Self { [INFO] [stdout] 62 | | TranspositionSide::Auto [INFO] [stdout] 63 | | } [INFO] [stdout] 64 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 53 + #[derive(Default)] [INFO] [stdout] 54 | pub enum TranspositionSide { [INFO] [stdout] 55 | /// Automatically determine the transposition side [INFO] [stdout] 56 ~ #[default] [INFO] [stdout] 57 ~ Auto, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/api/transpose.rs:525:32 [INFO] [stdout] | [INFO] [stdout] 525 | ... if !self.rootstore().annotation(source_id.as_str()).is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.rootstore().annotation(source_id.as_str()).is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/api/transpose.rs:154:13 [INFO] [stdout] | [INFO] [stdout] 154 | self.inner().iter().map(|x| x.clone()).collect(); //MAYBE TODO: slightly waste of time/space if the transposition turns... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `self.inner().iter().copied()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `TextSelection` which implements the `Copy` trait [INFO] [stdout] --> src/api/transpose.rs:154:41 [INFO] [stdout] | [INFO] [stdout] 154 | ... self.inner().iter().map(|x| x.clone()).collect(); //MAYBE TODO: slightly waste of time/space if the transposition turns out t... [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*x` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/api/transpose.rs:161:20 [INFO] [stdout] | [INFO] [stdout] 161 | let sides: SmallVec< [INFO] [stdout] | ____________________^ [INFO] [stdout] 162 | | [( [INFO] [stdout] 163 | | SmallVec<[ResultTextSelection<'store>; 1]>, //textselections [INFO] [stdout] 164 | | ResultItem<'store, Annotation>, //annotation [INFO] [stdout] 165 | | ); 2], [INFO] [stdout] 166 | | > = via [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `TextSelection` which implements the `Copy` trait [INFO] [stdout] --> src/api/transpose.rs:185:98 [INFO] [stdout] | [INFO] [stdout] 185 | let tsel = ResultTextSelection::Unbound(self.rootstore(), resource.as_ref() ,tsel.clone()); [INFO] [stdout] | ^^^^^^^^^^^^ help: try removing the `clone` call: `tsel` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `TextSelection` which implements the `Copy` trait [INFO] [stdout] --> src/api/transpose.rs:222:113 [INFO] [stdout] | [INFO] [stdout] 222 | ... let tmp = ResultTextSelection::Unbound(self.rootstore(), resource.as_ref() ,tsel.clone()); [INFO] [stdout] | ^^^^^^^^^^^^ help: try removing the `clone` call: `tsel` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `TextSelection` which implements the `Copy` trait [INFO] [stdout] --> src/api/transpose.rs:223:120 [INFO] [stdout] | [INFO] [stdout] 223 | ... let remainder = ResultTextSelection::Unbound(self.rootstore(), resource.as_ref() ,remainder.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `remainder` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `TextSelection` which implements the `Copy` trait [INFO] [stdout] --> src/api/transpose.rs:231:130 [INFO] [stdout] | [INFO] [stdout] 231 | ...store(), resource.as_ref() ,intersection.clone())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `intersection` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `TextSelection` which implements the `Copy` trait [INFO] [stdout] --> src/api/transpose.rs:237:113 [INFO] [stdout] | [INFO] [stdout] 237 | ... let tmp = ResultTextSelection::Unbound(self.rootstore(), resource.as_ref() ,tsel.clone()); [INFO] [stdout] | ^^^^^^^^^^^^ help: try removing the `clone` call: `tsel` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `TextSelection` which implements the `Copy` trait [INFO] [stdout] --> src/api/transpose.rs:244:130 [INFO] [stdout] | [INFO] [stdout] 244 | ...store(), resource.as_ref() ,intersection.clone())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `intersection` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/transpose.rs:318:65 [INFO] [stdout] | [INFO] [stdout] 318 | let mapped_tsel = reftsel.textselection(&offset)?; [INFO] [stdout] | ^^^^^^^ help: change this to: `offset` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/transpose.rs:351:65 [INFO] [stdout] | [INFO] [stdout] 351 | let mapped_tsel = reftsel.textselection(&relative_offset)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: change this to: `relative_offset` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/api/translate.rs:62:1 [INFO] [stdout] | [INFO] [stdout] 62 | / impl Default for TranslationSide { [INFO] [stdout] 63 | | fn default() -> Self { [INFO] [stdout] 64 | | TranslationSide::Auto [INFO] [stdout] 65 | | } [INFO] [stdout] 66 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 55 + #[derive(Default)] [INFO] [stdout] 56 | pub enum TranslationSide { [INFO] [stdout] 57 | /// Automatically determine the translation side [INFO] [stdout] 58 ~ #[default] [INFO] [stdout] 59 ~ Auto, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/api/translate.rs:499:32 [INFO] [stdout] | [INFO] [stdout] 499 | ... if !self.rootstore().annotation(source_id.as_str()).is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.rootstore().annotation(source_id.as_str()).is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/api/translate.rs:166:20 [INFO] [stdout] | [INFO] [stdout] 166 | let sides: SmallVec< [INFO] [stdout] | ____________________^ [INFO] [stdout] 167 | | [( [INFO] [stdout] 168 | | SmallVec<[ResultTextSelection<'store>; 1]>, //textselections [INFO] [stdout] 169 | | ResultItem<'store, Annotation>, //annotation [INFO] [stdout] 170 | | ); 2], [INFO] [stdout] 171 | | > = via [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `TextSelection` which implements the `Copy` trait [INFO] [stdout] --> src/api/translate.rs:198:25 [INFO] [stdout] | [INFO] [stdout] 198 | tsel.clone(), [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*tsel` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `TextSelection` which implements the `Copy` trait [INFO] [stdout] --> src/api/translate.rs:208:42 [INFO] [stdout] | [INFO] [stdout] 208 | let mut remainder = Some(tsel.clone()); [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*tsel` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/api/translate.rs:608:61 [INFO] [stdout] | [INFO] [stdout] 608 | for (_side, selectors) in selectors_per_side.into_iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] = note: `#[warn(clippy::unused_enumerate_index)]` on by default [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 608 - for (_side, selectors) in selectors_per_side.into_iter().enumerate() { [INFO] [stdout] 608 + for selectors in selectors_per_side.into_iter() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `selectors.get(0)` [INFO] [stdout] --> src/api/translate.rs:610:24 [INFO] [stdout] | [INFO] [stdout] 610 | let resource = selectors.get(0).unwrap().resource().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try: `selectors.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_ok()` [INFO] [stdout] --> src/api.rs:201:13 [INFO] [stdout] | [INFO] [stdout] 201 | / match self.array.binary_search(&handle) { [INFO] [stdout] 202 | | Ok(_) => true, [INFO] [stdout] 203 | | Err(_) => false, [INFO] [stdout] 204 | | } [INFO] [stdout] | |_____________^ help: try: `self.array.binary_search(&handle).is_ok()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api.rs:201:44 [INFO] [stdout] | [INFO] [stdout] 201 | match self.array.binary_search(&handle) { [INFO] [stdout] | ^^^^^^^ help: change this to: `handle` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api.rs:206:33 [INFO] [stdout] | [INFO] [stdout] 206 | self.array.contains(&handle) [INFO] [stdout] | ^^^^^^^ help: change this to: `handle` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `ok` [INFO] [stdout] --> src/api.rs:213:13 [INFO] [stdout] | [INFO] [stdout] 213 | / match self.array.binary_search(&handle) { [INFO] [stdout] 214 | | Ok(index) => Some(index), [INFO] [stdout] 215 | | Err(_) => None, [INFO] [stdout] 216 | | } [INFO] [stdout] | |_____________^ help: replace with: `self.array.binary_search(&handle).ok()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_ok_err [INFO] [stdout] = note: `#[warn(clippy::manual_ok_err)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api.rs:213:44 [INFO] [stdout] | [INFO] [stdout] 213 | match self.array.binary_search(&handle) { [INFO] [stdout] | ^^^^^^^ help: change this to: `handle` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/api.rs:250:18 [INFO] [stdout] | [INFO] [stdout] 250 | 0 => return, //edge-case [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: replace `return` with a unit value [INFO] [stdout] | [INFO] [stdout] 250 - 0 => return, //edge-case [INFO] [stdout] 250 + 0 => (), //edge-case [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/api.rs:724:20 [INFO] [stdout] | [INFO] [stdout] 724 | if ((self.begin < 0) || (self.begin >= 0 && self.cursor >= self.begin)) [INFO] [stdout] | ____________________^ [INFO] [stdout] 725 | | && ((self.end <= 0) || (self.cursor < self.end)) [INFO] [stdout] | |____________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 724 - if ((self.begin < 0) || (self.begin >= 0 && self.cursor >= self.begin)) [INFO] [stdout] 725 - && ((self.end <= 0) || (self.cursor < self.end)) [INFO] [stdout] 724 + if !(self.begin >= 0 && self.cursor < self.begin || self.end > 0 && self.cursor >= self.end) [INFO] [stdout] | [INFO] [stdout] 724 - if ((self.begin < 0) || (self.begin >= 0 && self.cursor >= self.begin)) [INFO] [stdout] 725 - && ((self.end <= 0) || (self.cursor < self.end)) [INFO] [stdout] 724 + if ((self.cursor < self.end) || (self.end <= 0)) && (self.cursor >= self.begin || (self.begin < 0)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/api.rs:724:20 [INFO] [stdout] | [INFO] [stdout] 724 | if ((self.begin < 0) || (self.begin >= 0 && self.cursor >= self.begin)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 724 - if ((self.begin < 0) || (self.begin >= 0 && self.cursor >= self.begin)) [INFO] [stdout] 724 + if !(self.begin >= 0 && self.cursor < self.begin) [INFO] [stdout] | [INFO] [stdout] 724 - if ((self.begin < 0) || (self.begin >= 0 && self.cursor >= self.begin)) [INFO] [stdout] 724 + if (self.begin < 0) || self.cursor >= self.begin [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `isize::abs()` to usize [INFO] [stdout] --> src/api.rs:730:48 [INFO] [stdout] | [INFO] [stdout] 730 | if self.buffer.len() > self.begin.abs() as usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `self.begin.unsigned_abs()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned [INFO] [stdout] = note: `#[warn(clippy::cast_abs_to_unsigned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `isize::abs()` to usize [INFO] [stdout] --> src/api.rs:731:62 [INFO] [stdout] | [INFO] [stdout] 731 | ... let excess = self.buffer.len() - self.begin.abs() as usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `self.begin.unsigned_abs()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/api.rs:781:1 [INFO] [stdout] | [INFO] [stdout] 781 | / impl Default for FilterMode { [INFO] [stdout] 782 | | fn default() -> Self { [INFO] [stdout] 783 | | Self::Any [INFO] [stdout] 784 | | } [INFO] [stdout] 785 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 772 + #[derive(Default)] [INFO] [stdout] 773 | pub enum FilterMode { [INFO] [stdout] 774 | /// The filter succeeds if any match is found. [INFO] [stdout] 775 ~ #[default] [INFO] [stdout] 776 ~ Any, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/api.rs:794:1 [INFO] [stdout] | [INFO] [stdout] 794 | / impl Default for TextMode { [INFO] [stdout] 795 | | fn default() -> Self { [INFO] [stdout] 796 | | Self::Exact [INFO] [stdout] 797 | | } [INFO] [stdout] 798 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 789 + #[derive(Default)] [INFO] [stdout] 790 | pub enum TextMode { [INFO] [stdout] 791 ~ #[default] [INFO] [stdout] 792 ~ Exact, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/cbor.rs:99:46 [INFO] [stdout] | [INFO] [stdout] 99 | DateTime::parse_from_rfc3339(&s).map_err(|err| minicbor::decode::Error::custom(err)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `minicbor::decode::Error::custom` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/config.rs:23:1 [INFO] [stdout] | [INFO] [stdout] 23 | / impl Default for SerializeMode { [INFO] [stdout] 24 | | fn default() -> Self { [INFO] [stdout] 25 | | Self::NoInclude [INFO] [stdout] 26 | | } [INFO] [stdout] 27 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 15 + #[derive(Default)] [INFO] [stdout] 16 | pub(crate) enum SerializeMode { [INFO] [stdout] 17 | /// Allow serialisation of stand-off files (which means we allow @include) [INFO] [stdout] ... [INFO] [stdout] 20 | ///We are in standoff mode to serialized stand-off files (which means we don't output @include again) [INFO] [stdout] 21 ~ #[default] [INFO] [stdout] 22 ~ NoInclude, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.as_ref().map(|x| x.as_path())` on an `Option` value [INFO] [stdout] --> src/config.rs:338:9 [INFO] [stdout] | [INFO] [stdout] 338 | self.workdir.as_ref().map(|x| x.as_path()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using as_deref: `self.workdir.as_deref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_as_ref_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the impl [INFO] [stdout] --> src/datakey.rs:87:6 [INFO] [stdout] | [INFO] [stdout] 87 | impl<'a> Request for DataKeyHandle { [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'store [INFO] [stdout] --> src/datakey.rs:88:18 [INFO] [stdout] | [INFO] [stdout] 88 | fn to_handle<'store, S>(&self, _store: &'store S) -> Option [INFO] [stdout] | ^^^^^^ ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 88 - fn to_handle<'store, S>(&self, _store: &'store S) -> Option [INFO] [stdout] 88 + fn to_handle(&self, _store: &S) -> Option [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the impl [INFO] [stdout] --> src/datakey.rs:95:6 [INFO] [stdout] | [INFO] [stdout] 95 | impl<'a> Request for Option { [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'store [INFO] [stdout] --> src/datakey.rs:96:18 [INFO] [stdout] | [INFO] [stdout] 96 | fn to_handle<'store, S>(&self, _store: &'store S) -> Option [INFO] [stdout] | ^^^^^^ ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 96 - fn to_handle<'store, S>(&self, _store: &'store S) -> Option [INFO] [stdout] 96 + fn to_handle(&self, _store: &S) -> Option [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/datavalue.rs:175:61 [INFO] [stdout] | [INFO] [stdout] 175 | (Self::Bool(true), DataOperator::Equals(s2)) => match s2.to_lowercase().as_str() { [INFO] [stdout] | _____________________________________________________________^ [INFO] [stdout] 176 | | "yes" | "1" | "enable" | "enabled" | "on" | "true" => true, [INFO] [stdout] 177 | | _ => false, [INFO] [stdout] 178 | | }, [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 175 - (Self::Bool(true), DataOperator::Equals(s2)) => match s2.to_lowercase().as_str() { [INFO] [stdout] 176 - "yes" | "1" | "enable" | "enabled" | "on" | "true" => true, [INFO] [stdout] 177 - _ => false, [INFO] [stdout] 178 - }, [INFO] [stdout] 175 + (Self::Bool(true), DataOperator::Equals(s2)) => matches!(s2.to_lowercase().as_str(), "yes" | "1" | "enable" | "enabled" | "on" | "true"), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/datavalue.rs:179:62 [INFO] [stdout] | [INFO] [stdout] 179 | (Self::Bool(false), DataOperator::Equals(s2)) => match s2.to_lowercase().as_str() { [INFO] [stdout] | ______________________________________________________________^ [INFO] [stdout] 180 | | "yes" | "1" | "enable" | "enabled" | "on" | "true" => false, [INFO] [stdout] 181 | | _ => true, [INFO] [stdout] 182 | | }, [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 179 - (Self::Bool(false), DataOperator::Equals(s2)) => match s2.to_lowercase().as_str() { [INFO] [stdout] 180 - "yes" | "1" | "enable" | "enabled" | "on" | "true" => false, [INFO] [stdout] 181 - _ => true, [INFO] [stdout] 182 - }, [INFO] [stdout] 179 + (Self::Bool(false), DataOperator::Equals(s2)) => !matches!(s2.to_lowercase().as_str(), "yes" | "1" | "enable" | "enabled" | "on" | "true"), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of left operand [INFO] [stdout] --> src/datavalue.rs:183:60 [INFO] [stdout] | [INFO] [stdout] 183 | (Self::String(s), DataOperator::Equals(s2)) => &s.as_str() == s2, [INFO] [stdout] | -----------^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: use the left value directly: `s.as_str()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] = note: `#[warn(clippy::op_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/datavalue.rs:231:50 [INFO] [stdout] | [INFO] [stdout] 231 | v.get(s.as_ref()).map(|e| e.test(&op)).unwrap_or(false) [INFO] [stdout] | ^^^ help: change this to: `op` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.iter().nth()` on a `Vec` [INFO] [stdout] --> src/datavalue.rs:234:69 [INFO] [stdout] | [INFO] [stdout] 234 | (Self::List(v), DataOperator::GetIndex(i, Some(op))) => v [INFO] [stdout] | _____________________________________________________________________^ [INFO] [stdout] 235 | | .iter() [INFO] [stdout] 236 | | .nth(*i as usize) [INFO] [stdout] | |_________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth [INFO] [stdout] help: `get` is equivalent but more concise [INFO] [stdout] | [INFO] [stdout] 235 - .iter() [INFO] [stdout] 236 - .nth(*i as usize) [INFO] [stdout] 235 + .get(*i as usize) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/datavalue.rs:237:33 [INFO] [stdout] | [INFO] [stdout] 237 | .map(|e| e.test(&op)) [INFO] [stdout] | ^^^ help: change this to: `op` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of a fallible conversion when an infallible one could be used [INFO] [stdout] --> src/datavalue.rs:385:24 [INFO] [stdout] | [INFO] [stdout] 385 | Self::Int(item.try_into().unwrap()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: converting `u8` to `isize` cannot fail [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fallible_conversions [INFO] [stdout] help: use [INFO] [stdout] | [INFO] [stdout] 385 - Self::Int(item.try_into().unwrap()) [INFO] [stdout] 385 + Self::Int(item.into()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/datavalue.rs:600:37 [INFO] [stdout] | [INFO] [stdout] 600 | DataOperator::Any => Ok(format!("= any")), [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"= any".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/datavalue.rs:601:38 [INFO] [stdout] | [INFO] [stdout] 601 | DataOperator::Null => Ok(format!("= null")), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"= null".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/datavalue.rs:602:38 [INFO] [stdout] | [INFO] [stdout] 602 | DataOperator::True => Ok(format!("= true")), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"= true".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/datavalue.rs:603:39 [INFO] [stdout] | [INFO] [stdout] 603 | DataOperator::False => Ok(format!("= false")), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"= false".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/file.rs:54:23 [INFO] [stdout] | [INFO] [stdout] 54 | PathBuf::from(&filename[7..]) [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/file.rs:52:16 [INFO] [stdout] | [INFO] [stdout] 52 | let path = if filename.starts_with("file://") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 52 ~ let path = if let Some() = filename.strip_prefix("file://") { [INFO] [stdout] 53 | //strip the file:// prefix [INFO] [stdout] 54 ~ PathBuf::from() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/file.rs:155:49 [INFO] [stdout] | [INFO] [stdout] 155 | let mut id = id.replace("://", ".").replace(&['/', '\\', ':', '?'], "."); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `['/', '\\', ':', '?']` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/file.rs:168:28 [INFO] [stdout] | [INFO] [stdout] 168 | let filename = &filename[workdir.len()..]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/file.rs:167:9 [INFO] [stdout] | [INFO] [stdout] 167 | if filename.starts_with(workdir) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 167 ~ if let Some(filename) = filename.strip_prefix(workdir) { [INFO] [stdout] 168 ~ if filename.starts_with(&['/', '\\']) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/file.rs:169:37 [INFO] [stdout] | [INFO] [stdout] 169 | if filename.starts_with(&['/', '\\']) { [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `['/', '\\']` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/file.rs:223:33 [INFO] [stdout] | [INFO] [stdout] 223 | debug(self.config(), || format!("dirname(): none")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"dirname(): none".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/json.rs:78:49 [INFO] [stdout] | [INFO] [stdout] 78 | let writer = open_file_writer(filename, &config)?; [INFO] [stdout] | ^^^^^^^ help: change this to: `config` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/json.rs:128:30 [INFO] [stdout] | [INFO] [stdout] 128 | serde_json::to_value(&self).map_err(|e| { [INFO] [stdout] | ^^^^^ help: change this to: `self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the impl [INFO] [stdout] --> src/resources.rs:132:6 [INFO] [stdout] | [INFO] [stdout] 132 | impl<'a> Request for TextResourceHandle { [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'store [INFO] [stdout] --> src/resources.rs:133:18 [INFO] [stdout] | [INFO] [stdout] 133 | fn to_handle<'store, S>(&self, _store: &'store S) -> Option [INFO] [stdout] | ^^^^^^ ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 133 - fn to_handle<'store, S>(&self, _store: &'store S) -> Option [INFO] [stdout] 133 + fn to_handle(&self, _store: &S) -> Option [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `self.filename` after checking its variant with `is_some` [INFO] [stdout] --> src/resources.rs:241:28 [INFO] [stdout] | [INFO] [stdout] 240 | if self.filename.is_some() && self.config.serialize_mode() == SerializeMode::AllowInclude { [INFO] [stdout] | ----------------------- the check is happening here [INFO] [stdout] 241 | let filename = self.filename.as_ref().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/resources.rs:242:34 [INFO] [stdout] | [INFO] [stdout] 242 | if self.id() != Some(&filename) { [INFO] [stdout] | ^^^^^^^^^ help: change this to: `filename` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::string::String` [INFO] [stdout] --> src/resources.rs:535:19 [INFO] [stdout] | [INFO] [stdout] 535 | text: text.into(), [INFO] [stdout] | ^^^^^^^^^^^ help: consider removing `.into()`: `text` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary map of the identity function [INFO] [stdout] --> src/resources.rs:627:45 [INFO] [stdout] | [INFO] [stdout] 627 | .filter_map(|item| item.as_ref().map(|textselection| textselection)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove the call to `map` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_identity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/resources.rs:774:9 [INFO] [stdout] | [INFO] [stdout] 774 | return data_size(self); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 774 - return data_size(self); [INFO] [stdout] 774 + data_size(self) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.as_ref().map(|x| x.as_str())` on an `Option` value [INFO] [stdout] --> src/resources.rs:946:9 [INFO] [stdout] | [INFO] [stdout] 946 | self.filename.as_ref().map(|x| x.as_str()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using as_deref: `self.filename.as_deref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_as_ref_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.as_ref().map(|s| s.as_str())` on an `Option` value [INFO] [stdout] --> src/resources.rs:951:12 [INFO] [stdout] | [INFO] [stdout] 951 | if self.filename.as_ref().map(|s| s.as_str()) != Some(filename) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using as_deref: `self.filename.as_deref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_as_ref_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/selector.rs:55:9 [INFO] [stdout] | [INFO] [stdout] 55 | / match (self.begin, self.end) { [INFO] [stdout] 56 | | (Cursor::BeginAligned(_), Cursor::BeginAligned(_)) => true, [INFO] [stdout] 57 | | _ => false [INFO] [stdout] 58 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 55 - match (self.begin, self.end) { [INFO] [stdout] 56 - (Cursor::BeginAligned(_), Cursor::BeginAligned(_)) => true, [INFO] [stdout] 57 - _ => false [INFO] [stdout] 58 - } [INFO] [stdout] 55 + matches!((self.begin, self.end), (Cursor::BeginAligned(_), Cursor::BeginAligned(_))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/selector.rs:63:9 [INFO] [stdout] | [INFO] [stdout] 63 | / match (self.begin, self.end) { [INFO] [stdout] 64 | | (Cursor::BeginAligned(_), Cursor::BeginAligned(_)) => true, [INFO] [stdout] 65 | | (Cursor::BeginAligned(0), Cursor::EndAligned(0)) => true, [INFO] [stdout] 66 | | _ => false [INFO] [stdout] 67 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 63 - match (self.begin, self.end) { [INFO] [stdout] 64 - (Cursor::BeginAligned(_), Cursor::BeginAligned(_)) => true, [INFO] [stdout] 65 - (Cursor::BeginAligned(0), Cursor::EndAligned(0)) => true, [INFO] [stdout] 66 - _ => false [INFO] [stdout] 67 - } [INFO] [stdout] 63 + matches!((self.begin, self.end), (Cursor::BeginAligned(_), Cursor::BeginAligned(_)) | (Cursor::BeginAligned(0), Cursor::EndAligned(0))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Offset` has a public `len` method, but no `is_empty` method [INFO] [stdout] --> src/selector.rs:102:5 [INFO] [stdout] | [INFO] [stdout] 102 | pub fn len(&self) -> Option { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_without_is_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `isize::abs()` to usize [INFO] [stdout] --> src/selector.rs:105:74 [INFO] [stdout] | [INFO] [stdout] 105 | (Cursor::EndAligned(begin), Cursor::EndAligned(end)) => Some((end - begin).abs() as usize), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `(end - begin).unsigned_abs()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/selector.rs:158:1 [INFO] [stdout] | [INFO] [stdout] 158 | / impl Default for OffsetMode { [INFO] [stdout] 159 | | fn default() -> Self { [INFO] [stdout] 160 | | Self::BeginBegin [INFO] [stdout] 161 | | } [INFO] [stdout] 162 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 137 + #[derive(Default)] [INFO] [stdout] 138 | pub enum OffsetMode { [INFO] [stdout] 139 | /// Offset where both the begin and end positions are specified using a begin-aligned cursor ([`Cursor::BeginAligned`]) [INFO] [stdout] 140 | /// This is by-far the most common offset mode. [INFO] [stdout] 141 | #[n(0)] [INFO] [stdout] 142 ~ #[default] [INFO] [stdout] 143 ~ BeginBegin, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> src/selector.rs:223:31 [INFO] [stdout] | [INFO] [stdout] 223 | let begin: isize = if fields.len() >= 1 && fields.get(0) != Some(&"") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!fields.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `fields.get(0)` [INFO] [stdout] --> src/selector.rs:223:52 [INFO] [stdout] | [INFO] [stdout] 223 | let begin: isize = if fields.len() >= 1 && fields.get(0) != Some(&"") { [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `fields.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `fields.get(0)` [INFO] [stdout] --> src/selector.rs:224:13 [INFO] [stdout] | [INFO] [stdout] 224 | fields.get(0).unwrap().parse().map_err(|_| { [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `fields.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `Selector` has a public `len` method, but no `is_empty` method [INFO] [stdout] --> src/selector.rs:409:5 [INFO] [stdout] | [INFO] [stdout] 409 | pub fn len(&self) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_without_is_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/selector.rs:561:9 [INFO] [stdout] | [INFO] [stdout] 561 | / match self { [INFO] [stdout] 562 | | Self::MultiSelector => true, [INFO] [stdout] 563 | | Self::DirectionalSelector => true, [INFO] [stdout] 564 | | Self::CompositeSelector => true, [INFO] [stdout] 565 | | _ => false, [INFO] [stdout] 566 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 561 - match self { [INFO] [stdout] 562 - Self::MultiSelector => true, [INFO] [stdout] 563 - Self::DirectionalSelector => true, [INFO] [stdout] 564 - Self::CompositeSelector => true, [INFO] [stdout] 565 - _ => false, [INFO] [stdout] 566 - } [INFO] [stdout] 561 + matches!(self, Self::MultiSelector | Self::DirectionalSelector | Self::CompositeSelector) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: all variants have the same postfix: `Selector` [INFO] [stdout] --> src/selector.rs:730:1 [INFO] [stdout] | [INFO] [stdout] 730 | / enum SelectorJson where [INFO] [stdout] 731 | | { [INFO] [stdout] 732 | | ResourceSelector { [INFO] [stdout] 733 | | resource: String, [INFO] [stdout] ... | [INFO] [stdout] 756 | | DirectionalSelector{ selectors: Vec}, [INFO] [stdout] 757 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: remove the postfixes and use full paths to the variants instead of glob imports [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#enum_variant_names [INFO] [stdout] = note: `#[warn(clippy::enum_variant_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of `contains_key` followed by `insert` on a `BTreeMap` [INFO] [stdout] --> src/store.rs:276:9 [INFO] [stdout] | [INFO] [stdout] 276 | / if self.data.contains_key(&x) { [INFO] [stdout] 277 | | self.data.get_mut(&x).unwrap().push(y); [INFO] [stdout] 278 | | } else { [INFO] [stdout] 279 | | self.data.insert(x, vec![y]); [INFO] [stdout] 280 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_entry [INFO] [stdout] = note: `#[warn(clippy::map_entry)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 276 ~ if let std::collections::btree_map::Entry::Vacant(e) = self.data.entry(x) { [INFO] [stdout] 277 + e.insert(vec![y]); [INFO] [stdout] 278 + } else { [INFO] [stdout] 279 + self.data.get_mut(&x).unwrap().push(y); [INFO] [stdout] 280 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of `contains_key` followed by `insert` on a `BTreeMap` [INFO] [stdout] --> src/store.rs:542:9 [INFO] [stdout] | [INFO] [stdout] 542 | / if self.data.contains_key(&x) { [INFO] [stdout] 543 | | if let Some(entry) = self.data.get_mut(&x) { [INFO] [stdout] 544 | | *entry = y; [INFO] [stdout] ... | [INFO] [stdout] 547 | | self.data.insert(x, y); [INFO] [stdout] 548 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_entry [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 542 ~ if let std::collections::btree_map::Entry::Vacant(e) = self.data.entry(x) { [INFO] [stdout] 543 + e.insert(y); [INFO] [stdout] 544 + } else { [INFO] [stdout] 545 + if let Some(entry) = self.data.get_mut(&x) { [INFO] [stdout] 546 + *entry = y; [INFO] [stdout] 547 + } [INFO] [stdout] 548 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Some` variant of the iterator element is used [INFO] [stdout] --> src/store.rs:1036:13 [INFO] [stdout] | [INFO] [stdout] 1036 | / ... for item in self { [INFO] [stdout] 1037 | | ... if let Some(mut item) = item { [INFO] [stdout] 1038 | | ... let handle = item.handle().expect("handle must exist"); [INFO] [stdout] 1039 | | ... let newhandle = handle.reindex(gaps); //this does iterate over all gaps every time, not very efficient if there ar... [INFO] [stdout] ... | [INFO] [stdout] 1043 | | ... } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/store.rs:1037:17 [INFO] [stdout] | [INFO] [stdout] 1037 | / ... if let Some(mut item) = item { [INFO] [stdout] 1038 | | ... let handle = item.handle().expect("handle must exist"); [INFO] [stdout] 1039 | | ... let newhandle = handle.reindex(gaps); //this does iterate over all gaps every time, not very efficient if there are many [INFO] [stdout] 1040 | | ... item = item.with_handle(newhandle); [INFO] [stdout] 1041 | | ... newstore.push(Some(item)); [INFO] [stdout] 1042 | | ... } [INFO] [stdout] | |_______^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1036 ~ for mut item in self.into_iter().flatten() { [INFO] [stdout] 1037 + let handle = item.handle().expect("handle must exist"); [INFO] [stdout] 1038 + let newhandle = handle.reindex(gaps); //this does iterate over all gaps every time, not very efficient if there are many [INFO] [stdout] 1039 + item = item.with_handle(newhandle); [INFO] [stdout] 1040 + newstore.push(Some(item)); [INFO] [stdout] 1041 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-canonical implementation of `partial_cmp` on an `Ord` type [INFO] [stdout] --> src/store.rs:1195:1 [INFO] [stdout] | [INFO] [stdout] 1195 | / impl<'store, T> PartialOrd for ResultItem<'store, T> [INFO] [stdout] 1196 | | where [INFO] [stdout] 1197 | | T: Storable, [INFO] [stdout] ... | [INFO] [stdout] 1202 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_canonical_partial_ord_impl [INFO] [stdout] = note: `#[warn(clippy::non_canonical_partial_ord_impl)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 1199 - fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 1200 - Some(self.handle().cmp(&other.handle())) [INFO] [stdout] 1201 - } [INFO] [stdout] 1199 + fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `as_ref` can be confused for the standard trait method `std::convert::AsRef::as_ref` [INFO] [stdout] --> src/store.rs:1270:5 [INFO] [stdout] | [INFO] [stdout] 1270 | / pub fn as_ref(&self) -> &'store T { [INFO] [stdout] 1271 | | //MAYBE TODO: This conflicts with the AsRef trait that has &self -> &T as signature , renamed this method to inner()? [INFO] [stdout] 1272 | | self.item [INFO] [stdout] 1273 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: consider implementing the trait `std::convert::AsRef` or choosing a less ambiguous method name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait [INFO] [stdout] = note: `#[warn(clippy::should_implement_trait)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the impl [INFO] [stdout] --> src/store.rs:1300:6 [INFO] [stdout] | [INFO] [stdout] 1300 | impl<'store, T> StamResult for Option [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/store.rs:1406:1 [INFO] [stdout] | [INFO] [stdout] 1406 | / impl<'a, T> Default for BuildItem<'a, T> [INFO] [stdout] 1407 | | where [INFO] [stdout] 1408 | | T: Storable, [INFO] [stdout] ... | [INFO] [stdout] 1413 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 1372 + #[derive(Default)] [INFO] [stdout] 1373 | pub enum BuildItem<'a, T> [INFO] [stdout] 1374 | where [INFO] [stdout] ... [INFO] [stdout] 1388 | #[serde(skip)] [INFO] [stdout] 1389 ~ #[default] [INFO] [stdout] 1390 ~ None, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/store.rs:1445:9 [INFO] [stdout] | [INFO] [stdout] 1445 | / match self { [INFO] [stdout] 1446 | | Self::Id(_) => true, [INFO] [stdout] 1447 | | Self::IdRef(_) => true, [INFO] [stdout] 1448 | | _ => false, [INFO] [stdout] 1449 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 1445 - match self { [INFO] [stdout] 1446 - Self::Id(_) => true, [INFO] [stdout] 1447 - Self::IdRef(_) => true, [INFO] [stdout] 1448 - _ => false, [INFO] [stdout] 1449 - } [INFO] [stdout] 1445 + matches!(self, Self::Id(_) | Self::IdRef(_)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'slf [INFO] [stdout] --> src/store.rs:1486:19 [INFO] [stdout] | [INFO] [stdout] 1486 | pub fn as_str<'slf>(&'slf self) -> Option<&'slf str> { [INFO] [stdout] | ^^^^ ^^^^ ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 1486 - pub fn as_str<'slf>(&'slf self) -> Option<&'slf str> { [INFO] [stdout] 1486 + pub fn as_str(&self) -> Option<&str> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'store [INFO] [stdout] --> src/store.rs:1528:18 [INFO] [stdout] | [INFO] [stdout] 1528 | fn to_handle<'store, S>(&self, store: &'store S) -> Option [INFO] [stdout] | ^^^^^^ ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 1528 - fn to_handle<'store, S>(&self, store: &'store S) -> Option [INFO] [stdout] 1528 + fn to_handle(&self, store: &S) -> Option [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'store [INFO] [stdout] --> src/store.rs:1569:18 [INFO] [stdout] | [INFO] [stdout] 1569 | fn to_handle<'store, S>(&self, store: &'store S) -> Option [INFO] [stdout] | ^^^^^^ ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 1569 - fn to_handle<'store, S>(&self, store: &'store S) -> Option [INFO] [stdout] 1569 + fn to_handle(&self, store: &S) -> Option [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the impl [INFO] [stdout] --> src/store.rs:1586:6 [INFO] [stdout] | [INFO] [stdout] 1586 | impl<'a, T> Request for bool [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'store [INFO] [stdout] --> src/store.rs:1590:18 [INFO] [stdout] | [INFO] [stdout] 1590 | fn to_handle<'store, S>(&self, _store: &'store S) -> Option [INFO] [stdout] | ^^^^^^ ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 1590 - fn to_handle<'store, S>(&self, _store: &'store S) -> Option [INFO] [stdout] 1590 + fn to_handle(&self, _store: &S) -> Option [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the impl [INFO] [stdout] --> src/store.rs:1601:6 [INFO] [stdout] | [INFO] [stdout] 1601 | impl<'a, T> Request for String [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'store [INFO] [stdout] --> src/store.rs:1605:18 [INFO] [stdout] | [INFO] [stdout] 1605 | fn to_handle<'store, S>(&self, store: &'store S) -> Option [INFO] [stdout] | ^^^^^^ ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 1605 - fn to_handle<'store, S>(&self, store: &'store S) -> Option [INFO] [stdout] 1605 + fn to_handle(&self, store: &S) -> Option [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'store [INFO] [stdout] --> src/store.rs:1626:18 [INFO] [stdout] | [INFO] [stdout] 1626 | fn to_handle<'store, S>(&self, _store: &'store S) -> Option [INFO] [stdout] | ^^^^^^ ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 1626 - fn to_handle<'store, S>(&self, _store: &'store S) -> Option [INFO] [stdout] 1626 + fn to_handle(&self, _store: &S) -> Option [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'store [INFO] [stdout] --> src/store.rs:1638:18 [INFO] [stdout] | [INFO] [stdout] 1638 | fn to_handle<'store, S>(&self, _store: &'store S) -> Option [INFO] [stdout] | ^^^^^^ ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 1638 - fn to_handle<'store, S>(&self, _store: &'store S) -> Option [INFO] [stdout] 1638 + fn to_handle(&self, _store: &S) -> Option [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'store [INFO] [stdout] --> src/store.rs:1650:18 [INFO] [stdout] | [INFO] [stdout] 1650 | fn to_handle<'store, S>(&self, store: &'store S) -> Option [INFO] [stdout] | ^^^^^^ ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 1650 - fn to_handle<'store, S>(&self, store: &'store S) -> Option [INFO] [stdout] 1650 + fn to_handle(&self, store: &S) -> Option [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'store [INFO] [stdout] --> src/store.rs:1668:18 [INFO] [stdout] | [INFO] [stdout] 1668 | fn to_handle<'store, S>(&self, store: &'store S) -> Option [INFO] [stdout] | ^^^^^^ ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 1668 - fn to_handle<'store, S>(&self, store: &'store S) -> Option [INFO] [stdout] 1668 + fn to_handle(&self, store: &S) -> Option [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enclosing `Some` and `?` operator are unneeded [INFO] [stdout] --> src/store.rs:1845:20 [INFO] [stdout] | [INFO] [stdout] 1845 | return Some(id[2..].parse().ok()?); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark [INFO] [stdout] = note: `#[warn(clippy::needless_question_mark)]` on by default [INFO] [stdout] help: remove the enclosing `Some` and `?` operator [INFO] [stdout] | [INFO] [stdout] 1845 - return Some(id[2..].parse().ok()?); [INFO] [stdout] 1845 + return id[2..].parse().ok(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/store.rs:1873:1 [INFO] [stdout] | [INFO] [stdout] 1873 | / impl Default for IdStrategy { [INFO] [stdout] 1874 | | fn default() -> Self { [INFO] [stdout] 1875 | | Self::UpdateVersion [INFO] [stdout] 1876 | | } [INFO] [stdout] 1877 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 1858 + #[derive(Default)] [INFO] [stdout] 1859 | pub enum IdStrategy { [INFO] [stdout] 1860 | /// The new ID is formed by adding a static suffix to the old ID [INFO] [stdout] ... [INFO] [stdout] 1866 | /// The new ID is formed by adding or incrementing a version suffix (v1,v2,v3,etc) to the old ID [INFO] [stdout] 1867 ~ #[default] [INFO] [stdout] 1868 ~ UpdateVersion, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should use the `starts_with` method [INFO] [stdout] --> src/store.rs:1896:20 [INFO] [stdout] | [INFO] [stdout] 1896 | if version.chars().next() == Some('v') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `version.starts_with('v')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#chars_next_cmp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/store.rs:1915:53 [INFO] [stdout] | [INFO] [stdout] 1915 | Err(StamError::DeserializationError(format!( [INFO] [stdout] | _____________________________________________________^ [INFO] [stdout] 1916 | | "IdStrategy expects value after = " [INFO] [stdout] 1917 | | ))) [INFO] [stdout] | |_________________^ help: consider using `.to_string()`: `"IdStrategy expects value after = ".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/substore.rs:78:9 [INFO] [stdout] | [INFO] [stdout] 78 | return data_size(self); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 78 - return data_size(self); [INFO] [stdout] 78 + data_size(self) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the impl [INFO] [stdout] --> src/substore.rs:137:6 [INFO] [stdout] | [INFO] [stdout] 137 | impl<'a> Request for AnnotationSubStoreHandle { [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'store [INFO] [stdout] --> src/substore.rs:138:18 [INFO] [stdout] | [INFO] [stdout] 138 | fn to_handle<'store, S>(&self, _store: &'store S) -> Option [INFO] [stdout] | ^^^^^^ ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 138 - fn to_handle<'store, S>(&self, _store: &'store S) -> Option [INFO] [stdout] 138 + fn to_handle(&self, _store: &S) -> Option [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead [INFO] [stdout] --> src/substore.rs:433:21 [INFO] [stdout] | [INFO] [stdout] 433 | / >::iter(self.store()) [INFO] [stdout] 434 | | .filter(|substore| substore.parents.contains(&Some(substore_handle))) [INFO] [stdout] 435 | | .next() [INFO] [stdout] | |_______________________________^ help: try: `>::iter(self.store()).find(|substore| substore.parents.contains(&Some(substore_handle)))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `isize::abs()` to usize [INFO] [stdout] --> src/text.rs:72:20 [INFO] [stdout] | [INFO] [stdout] 72 | if cursor.abs() as usize > self.textlen() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace with: `cursor.unsigned_abs()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `isize::abs()` to usize [INFO] [stdout] --> src/text.rs:78:41 [INFO] [stdout] | [INFO] [stdout] 78 | Ok(self.textlen() - cursor.abs() as usize) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace with: `cursor.unsigned_abs()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this item has comments with 4 forward slashes (`////`). These look like doc comments, but they aren't [INFO] [stdout] --> src/textselection.rs:42:1 [INFO] [stdout] | [INFO] [stdout] 42 | / /// Corresponds to a slice of the text. This only contains minimal [INFO] [stdout] 43 | | /// information; i.e. the begin offset, end offset and optionally a handle. [INFO] [stdout] 44 | | /// if the textselection is already known in the model. [INFO] [stdout] 45 | | //// [INFO] [stdout] ... | [INFO] [stdout] 50 | | /// accompany it explicitly when needed, such as in the higher-level wrapper [`ResultTextSelection`]. [INFO] [stdout] 51 | | pub struct TextSelection { [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#four_forward_slashes [INFO] [stdout] = note: `#[warn(clippy::four_forward_slashes)]` on by default [INFO] [stdout] help: make this a doc comment by removing one `/` [INFO] [stdout] | [INFO] [stdout] 45 - //// [INFO] [stdout] 46 - /// This is similar to [`Offset`], but that one uses cursors which may [INFO] [stdout] 45 + /// [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the impl [INFO] [stdout] --> src/textselection.rs:66:6 [INFO] [stdout] | [INFO] [stdout] 66 | impl<'a> Request for TextSelectionHandle { [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'store [INFO] [stdout] --> src/textselection.rs:67:18 [INFO] [stdout] | [INFO] [stdout] 67 | fn to_handle<'store, S>(&self, _store: &'store S) -> Option [INFO] [stdout] | ^^^^^^ ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 67 - fn to_handle<'store, S>(&self, _store: &'store S) -> Option [INFO] [stdout] 67 + fn to_handle(&self, _store: &S) -> Option [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/textselection.rs:187:9 [INFO] [stdout] | [INFO] [stdout] 187 | return Err(StamError::OtherError("Can not merge text selections")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 187 - return Err(StamError::OtherError("Can not merge text selections")); [INFO] [stdout] 187 + Err(StamError::OtherError("Can not merge text selections")) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `isize::abs()` to usize [INFO] [stdout] --> src/textselection.rs:344:38 [INFO] [stdout] | [INFO] [stdout] 344 | if textlen < x.abs() as usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace with: `x.unsigned_abs()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `isize::abs()` to usize [INFO] [stdout] --> src/textselection.rs:350:39 [INFO] [stdout] | [INFO] [stdout] 350 | ... textlen - (x.abs() as usize) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace with: `x.unsigned_abs()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `isize::abs()` to usize [INFO] [stdout] --> src/textselection.rs:360:38 [INFO] [stdout] | [INFO] [stdout] 360 | if textlen < x.abs() as usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace with: `x.unsigned_abs()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `isize::abs()` to usize [INFO] [stdout] --> src/textselection.rs:366:39 [INFO] [stdout] | [INFO] [stdout] 366 | ... textlen - (x.abs() as usize) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace with: `x.unsigned_abs()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `isize::abs()` to usize [INFO] [stdout] --> src/textselection.rs:380:20 [INFO] [stdout] | [INFO] [stdout] 380 | if cursor.abs() as usize > textlen { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace with: `cursor.unsigned_abs()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `isize::abs()` to usize [INFO] [stdout] --> src/textselection.rs:386:34 [INFO] [stdout] | [INFO] [stdout] 386 | Ok(textlen - cursor.abs() as usize) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace with: `cursor.unsigned_abs()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/textselection.rs:501:1 [INFO] [stdout] | [INFO] [stdout] 501 | / impl Default for PositionIndex { [INFO] [stdout] 502 | | fn default() -> Self { [INFO] [stdout] 503 | | Self(BTreeMap::new()) [INFO] [stdout] 504 | | } [INFO] [stdout] 505 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute [INFO] [stdout] | [INFO] [stdout] 499 + #[derive(Default)] [INFO] [stdout] 500 | pub(crate) struct PositionIndex(#[n(0)] pub(crate) BTreeMap); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/textselection.rs:554:26 [INFO] [stdout] | [INFO] [stdout] 554 | pub fn len_begin2end<'a>(&'a self) -> usize { [INFO] [stdout] | ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 554 - pub fn len_begin2end<'a>(&'a self) -> usize { [INFO] [stdout] 554 + pub fn len_begin2end(&self) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/textselection.rs:558:26 [INFO] [stdout] | [INFO] [stdout] 558 | pub fn len_end2begin<'a>(&'a self) -> usize { [INFO] [stdout] | ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 558 - pub fn len_end2begin<'a>(&'a self) -> usize { [INFO] [stdout] 558 + pub fn len_end2begin(&self) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-canonical implementation of `partial_cmp` on an `Ord` type [INFO] [stdout] --> src/textselection.rs:577:1 [INFO] [stdout] | [INFO] [stdout] 577 | / impl PartialOrd for PositionIndexItem { [INFO] [stdout] 578 | | fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 579 | | Some(self.bytepos.cmp(&other.bytepos)) [INFO] [stdout] 580 | | } [INFO] [stdout] 581 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_canonical_partial_ord_impl [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 578 - fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 579 - Some(self.bytepos.cmp(&other.bytepos)) [INFO] [stdout] 580 - } [INFO] [stdout] 578 + fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `ResultTextSelectionSet` has a public `len` method, but no `is_empty` method [INFO] [stdout] --> src/textselection.rs:611:5 [INFO] [stdout] | [INFO] [stdout] 611 | pub fn len(&self) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_without_is_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `TextSelection` which implements the `Copy` trait [INFO] [stdout] --> src/textselection.rs:667:18 [INFO] [stdout] | [INFO] [stdout] 667 | tset.add(textselection.as_ref().clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*textselection.as_ref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `TextSelection` which implements the `Copy` trait [INFO] [stdout] --> src/textselection.rs:682:49 [INFO] [stdout] | [INFO] [stdout] 682 | ResultTextSelection::Bound(item) => item.as_ref().clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*item.as_ref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `TextSelection` which implements the `Copy` trait [INFO] [stdout] --> src/textselection.rs:701:22 [INFO] [stdout] | [INFO] [stdout] 701 | tset.add(item.as_ref().clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*item.as_ref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `TextSelection` which implements the `Copy` trait [INFO] [stdout] --> src/textselection.rs:722:53 [INFO] [stdout] | [INFO] [stdout] 722 | ResultTextSelection::Bound(item) => item.as_ref().clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*item.as_ref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `self.data.get(0)` [INFO] [stdout] --> src/textselection.rs:1318:17 [INFO] [stdout] | [INFO] [stdout] 1318 | self.data.get(0) [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try: `self.data.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing last element with `self.data.get(self.data.len() - 1)` [INFO] [stdout] --> src/textselection.rs:1337:17 [INFO] [stdout] | [INFO] [stdout] 1337 | self.data.get(self.data.len() - 1) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.data.last()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_last_with_len [INFO] [stdout] = note: `#[warn(clippy::get_last_with_len)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this call to `from_str_radix` can be replaced with a call to `str::parse` [INFO] [stdout] --> src/types.rs:87:33 [INFO] [stdout] | [INFO] [stdout] 87 | let cursor: isize = isize::from_str_radix(cursor, 10).map_err(|_e| { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `cursor.parse::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_str_radix_10 [INFO] [stdout] = note: `#[warn(clippy::from_str_radix_10)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this call to `from_str_radix` can be replaced with a call to `str::parse` [INFO] [stdout] --> src/types.rs:93:33 [INFO] [stdout] | [INFO] [stdout] 93 | let cursor: usize = usize::from_str_radix(cursor, 10).map_err(|_e| { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `cursor.parse::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_str_radix_10 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `isize::abs()` to usize [INFO] [stdout] --> src/types.rs:119:27 [INFO] [stdout] | [INFO] [stdout] 119 | } else if distance.abs() as usize <= *cursor { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `distance.unsigned_abs()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `isize::abs()` to usize [INFO] [stdout] --> src/types.rs:120:52 [INFO] [stdout] | [INFO] [stdout] 120 | Ok(Self::BeginAligned(cursor - distance.abs() as usize)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `distance.unsigned_abs()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/types.rs:129:34 [INFO] [stdout] | [INFO] [stdout] 129 | if distance <= 0 { [INFO] [stdout] | __________________________________^ [INFO] [stdout] 130 | | Ok(Self::EndAligned(cursor + distance)) [INFO] [stdout] 131 | | } else if distance <= cursor.abs() { [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/types.rs:131:52 [INFO] [stdout] | [INFO] [stdout] 131 | } else if distance <= cursor.abs() { [INFO] [stdout] | ____________________________________________________^ [INFO] [stdout] 132 | | Ok(Self::EndAligned(cursor + distance)) [INFO] [stdout] 133 | | } else { [INFO] [stdout] | |_________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] = note: `#[warn(clippy::if_same_then_else)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/csv.rs:245:21 [INFO] [stdout] | [INFO] [stdout] 245 | / match subselector { [INFO] [stdout] 246 | | Selector::DataKeySelector(dataset, key) => { [INFO] [stdout] 247 | | let dataset: &AnnotationDataSet = [INFO] [stdout] 248 | | store.get(*dataset).expect("dataset must exist"); [INFO] [stdout] ... | [INFO] [stdout] 253 | | _ => {} [INFO] [stdout] 254 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 245 ~ if let Selector::DataKeySelector(dataset, key) = subselector { [INFO] [stdout] 246 + let dataset: &AnnotationDataSet = [INFO] [stdout] 247 + store.get(*dataset).expect("dataset must exist"); [INFO] [stdout] 248 + let key: &DataKey = [INFO] [stdout] 249 + dataset.get(*key).expect("key must exist"); [INFO] [stdout] 250 + out += key.id().expect("key must have an id"); [INFO] [stdout] 251 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/csv.rs:282:21 [INFO] [stdout] | [INFO] [stdout] 282 | / match subselector { [INFO] [stdout] 283 | | Selector::AnnotationDataSelector(dataset, data) => { [INFO] [stdout] 284 | | let dataset: &AnnotationDataSet = [INFO] [stdout] 285 | | store.get(*dataset).expect("dataset must exist"); [INFO] [stdout] ... | [INFO] [stdout] 294 | | _ => {} [INFO] [stdout] 295 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 282 ~ if let Selector::AnnotationDataSelector(dataset, data) = subselector { [INFO] [stdout] 283 + let dataset: &AnnotationDataSet = [INFO] [stdout] 284 + store.get(*dataset).expect("dataset must exist"); [INFO] [stdout] 285 + let data: &AnnotationData = [INFO] [stdout] 286 + dataset.get(*data).expect("key must exist"); [INFO] [stdout] 287 + if let Some(id) = data.id() { [INFO] [stdout] 288 + out += id; [INFO] [stdout] 289 + } else { [INFO] [stdout] 290 + out += data.temp_id().expect("temp_id must succeed").as_str(); [INFO] [stdout] 291 + } [INFO] [stdout] 292 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/csv.rs:368:1 [INFO] [stdout] | [INFO] [stdout] 368 | / impl Default for CsvTable { [INFO] [stdout] 369 | | fn default() -> Self { [INFO] [stdout] 370 | | CsvTable::StoreManifest [INFO] [stdout] 371 | | } [INFO] [stdout] 372 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 362 + #[derive(Default)] [INFO] [stdout] 363 | pub enum CsvTable { [INFO] [stdout] 364 ~ #[default] [INFO] [stdout] 365 ~ StoreManifest, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/csv.rs:402:49 [INFO] [stdout] | [INFO] [stdout] 402 | let writer = open_file_writer(filename, &config)?; [INFO] [stdout] | ^^^^^^^ help: change this to: `config` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/csv.rs:499:62 [INFO] [stdout] | [INFO] [stdout] 499 | return Err(StamError::SerializationError(format!( [INFO] [stdout] | ______________________________________________________________^ [INFO] [stdout] 500 | | "An annotations filename must be associated with the AnnotationStore for CSV serialization to work", [INFO] [stdout] 501 | | ))); [INFO] [stdout] | |_____________________^ help: consider using `.to_string()`: `"An annotations filename must be associated with the AnnotationStore for CSV serialization to work".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/csv.rs:506:43 [INFO] [stdout] | [INFO] [stdout] 506 | id: self.id().map(|x| Cow::Borrowed(x)), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Cow::Borrowed` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/csv.rs:520:66 [INFO] [stdout] | [INFO] [stdout] 520 | return Err(StamError::SerializationError(format!( [INFO] [stdout] | __________________________________________________________________^ [INFO] [stdout] 521 | | "AnnotationDataSet must have a set filename for CSV serialization to work", [INFO] [stdout] 522 | | ))); [INFO] [stdout] | |_________________________^ help: consider using `.to_string()`: `"AnnotationDataSet must have a set filename for CSV serialization to work".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/csv.rs:524:66 [INFO] [stdout] | [INFO] [stdout] 524 | return Err(StamError::SerializationError(format!( [INFO] [stdout] | __________________________________________________________________^ [INFO] [stdout] 525 | | "AnnotationDataSet is still associated with a STAM JSON file, can't serialize to CSV yet", [INFO] [stdout] 526 | | ))); [INFO] [stdout] | |_________________________^ help: consider using `.to_string()`: `"AnnotationDataSet is still associated with a STAM JSON file, can't serialize to CSV yet".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/csv.rs:531:50 [INFO] [stdout] | [INFO] [stdout] 531 | ... id: dataset.id().map(|x| Cow::Borrowed(x)), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Cow::Borrowed` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/csv.rs:534:38 [INFO] [stdout] | [INFO] [stdout] 534 | ... .map(|x| Cow::Borrowed(x)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Cow::Borrowed` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/csv.rs:546:66 [INFO] [stdout] | [INFO] [stdout] 546 | return Err(StamError::SerializationError(format!( [INFO] [stdout] | __________________________________________________________________^ [INFO] [stdout] 547 | | "TextResource must have a set filename (plain text!) for CSV serialization to work", [INFO] [stdout] 548 | | ))); [INFO] [stdout] | |_________________________^ help: consider using `.to_string()`: `"TextResource must have a set filename (plain text!) for CSV serialization to work".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/csv.rs:550:66 [INFO] [stdout] | [INFO] [stdout] 550 | return Err(StamError::SerializationError(format!( [INFO] [stdout] | __________________________________________________________________^ [INFO] [stdout] 551 | | "TextResource is still associated with a STAM JSON file, can't serialize yet", [INFO] [stdout] 552 | | ))); [INFO] [stdout] | |_________________________^ help: consider using `.to_string()`: `"TextResource is still associated with a STAM JSON file, can't serialize yet".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/csv.rs:557:51 [INFO] [stdout] | [INFO] [stdout] 557 | ... id: resource.id().map(|x| Cow::Borrowed(x)), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Cow::Borrowed` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/csv.rs:560:38 [INFO] [stdout] | [INFO] [stdout] 560 | ... .map(|x| Cow::Borrowed(x)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Cow::Borrowed` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/csv.rs:620:53 [INFO] [stdout] | [INFO] [stdout] 620 | ... id: annotation.id().map(|x| Cow::Borrowed(x)), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Cow::Borrowed` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/csv.rs:683:53 [INFO] [stdout] | [INFO] [stdout] 683 | ... id: annotation.id().map(|x| Cow::Borrowed(x)), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Cow::Borrowed` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/csv.rs:745:30 [INFO] [stdout] | [INFO] [stdout] 745 | .map(|x| Cow::Borrowed(x)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Cow::Borrowed` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/csv.rs:767:30 [INFO] [stdout] | [INFO] [stdout] 767 | .map(|x| Cow::Borrowed(x)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Cow::Borrowed` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the impl [INFO] [stdout] --> src/csv.rs:807:10 [INFO] [stdout] | [INFO] [stdout] 807 | impl<'a, 'b> TryInto> for AnnotationCsv<'a> { [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/csv.rs:818:21 [INFO] [stdout] | [INFO] [stdout] 818 | format!("AnnotationDataSet column may not be empty",), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"AnnotationDataSet column may not be empty".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/csv.rs:842:21 [INFO] [stdout] | [INFO] [stdout] 842 | format!("A complex selector can not be defined without any subselectors"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"A complex selector can not be defined without any subselectors".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/csv.rs:847:21 [INFO] [stdout] | [INFO] [stdout] 847 | format!("The SelectorType column can not be empty"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"The SelectorType column can not be empty".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/csv.rs:855:25 [INFO] [stdout] | [INFO] [stdout] 855 | format!("Multiple target resources were specified, but without a complex selector"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Multiple target resources were specified, but without a complex selector".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/csv.rs:861:25 [INFO] [stdout] | [INFO] [stdout] 861 | format!("Multiple target annotation datasets were specified, but without a complex selector"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Multiple target annotation datasets were specified, but without a complex selector".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/csv.rs:867:25 [INFO] [stdout] | [INFO] [stdout] 867 | format!("Multiple target annotations were specified, but without a complex selector"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Multiple target annotations were specified, but without a complex selector".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/csv.rs:873:25 [INFO] [stdout] | [INFO] [stdout] 873 | / format!( [INFO] [stdout] 874 | | "Multiple begin offsets were specified, but without a complex selector" [INFO] [stdout] 875 | | ), [INFO] [stdout] | |_________________________^ help: consider using `.to_string()`: `"Multiple begin offsets were specified, but without a complex selector".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/csv.rs:881:25 [INFO] [stdout] | [INFO] [stdout] 881 | / format!( [INFO] [stdout] 882 | | "Multiple end offsets were specified, but without a complex selector" [INFO] [stdout] 883 | | ), [INFO] [stdout] | |_________________________^ help: consider using `.to_string()`: `"Multiple end offsets were specified, but without a complex selector".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/csv.rs:889:25 [INFO] [stdout] | [INFO] [stdout] 889 | format!("Multiple target keys were specified, but without a complex selector"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Multiple target keys were specified, but without a complex selector".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/csv.rs:895:25 [INFO] [stdout] | [INFO] [stdout] 895 | format!("Multiple target data were specified, but without a complex selector"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Multiple target data were specified, but without a complex selector".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `as_str` is redundant and can be removed as the method immediately following exists on `String` too [INFO] [stdout] --> src/csv.rs:912:44 [INFO] [stdout] | [INFO] [stdout] 912 | ... if !self.begin.as_str().is_empty() && !self.end.as_str().is_empty() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `is_empty` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_as_str [INFO] [stdout] = note: `#[warn(clippy::redundant_as_str)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `as_str` is redundant and can be removed as the method immediately following exists on `String` too [INFO] [stdout] --> src/csv.rs:912:77 [INFO] [stdout] | [INFO] [stdout] 912 | ... if !self.begin.as_str().is_empty() && !self.end.as_str().is_empty() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `is_empty` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_as_str [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/csv.rs:1088:33 [INFO] [stdout] | [INFO] [stdout] 1088 | / ... format!( [INFO] [stdout] 1089 | | ... "Complex selectors can't be a subselector under a complex selector" [INFO] [stdout] 1090 | | ... ), [INFO] [stdout] | |_______________________^ help: consider using `.to_string()`: `"Complex selectors can't be a subselector under a complex selector".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/csv.rs:1095:33 [INFO] [stdout] | [INFO] [stdout] 1095 | / ... format!( [INFO] [stdout] 1096 | | ... "Internal ranged selectors should have been resolved at this stage" [INFO] [stdout] 1097 | | ... ), [INFO] [stdout] | |_______________________^ help: consider using `.to_string()`: `"Internal ranged selectors should have been resolved at this stage".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods called `from_*` usually take no `self` [INFO] [stdout] --> src/csv.rs:1121:36 [INFO] [stdout] | [INFO] [stdout] 1121 | fn from_csv_annotations_reader(&mut self, reader: Box) -> Result<(), StamError> { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] = note: `#[warn(clippy::wrong_self_convention)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/csv.rs:1123:13 [INFO] [stdout] | [INFO] [stdout] 1123 | format!("AnnotationStore::from_csv_annotations_reader") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"AnnotationStore::from_csv_annotations_reader".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/csv.rs:1143:13 [INFO] [stdout] | [INFO] [stdout] 1143 | format!("AnnotationStore::from_csv_reader: processing store manifest") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"AnnotationStore::from_csv_reader: processing store manifest".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/csv.rs:1199:25 [INFO] [stdout] | [INFO] [stdout] 1199 | format!("There may be only one record with type AnnotationStore (the first one)"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"There may be only one record with type AnnotationStore (the first one)".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/csv.rs:1233:13 [INFO] [stdout] | [INFO] [stdout] 1233 | format!("AnnotationStore::from_csv_reader: finished processing annotations, entire builder ready, returning, ") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"AnnotationStore::from_csv_reader: finished processing annotations, entire builder ready, returning, ".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `record.id` after checking its variant with `is_none` [INFO] [stdout] --> src/csv.rs:1272:39 [INFO] [stdout] | [INFO] [stdout] 1269 | id: if record.id.is_none() || record.id.as_ref().unwrap().is_empty() { [INFO] [stdout] | ------------------- the check is happening here [INFO] [stdout] ... [INFO] [stdout] 1272 | BuildItem::Id(record.id.as_ref().unwrap().to_string()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/textvalidation.rs:41:1 [INFO] [stdout] | [INFO] [stdout] 41 | / impl Default for TextValidationMode { [INFO] [stdout] 42 | | fn default() -> Self { [INFO] [stdout] 43 | | Self::Auto [INFO] [stdout] 44 | | } [INFO] [stdout] 45 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 30 + #[derive(Default)] [INFO] [stdout] 31 | pub enum TextValidationMode { [INFO] [stdout] 32 | /// Use checksums [INFO] [stdout] ... [INFO] [stdout] 38 | /// Automatically choose based on text length [INFO] [stdout] 39 ~ #[default] [INFO] [stdout] 40 ~ Auto, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `usize` is unnecessary [INFO] [stdout] --> src/textvalidation.rs:89:31 [INFO] [stdout] | [INFO] [stdout] 89 | .fold(0 as usize, |a, x| a + (x.end() - x.begin())); [INFO] [stdout] | ^^^^^^^^^^ help: try: `0_usize` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/textvalidation.rs:183:9 [INFO] [stdout] | [INFO] [stdout] 183 | return total; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 183 - return total; [INFO] [stdout] 183 + total [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the impl [INFO] [stdout] --> src/annotation.rs:89:6 [INFO] [stdout] | [INFO] [stdout] 89 | impl<'a> Request for AnnotationHandle { [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] = note: `#[warn(clippy::extra_unused_lifetimes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'store [INFO] [stdout] --> src/annotation.rs:90:18 [INFO] [stdout] | [INFO] [stdout] 90 | fn to_handle<'store, S>(&self, _store: &'store S) -> Option [INFO] [stdout] | ^^^^^^ ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: `#[warn(clippy::needless_lifetimes)]` on by default [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 90 - fn to_handle<'store, S>(&self, _store: &'store S) -> Option [INFO] [stdout] 90 + fn to_handle(&self, _store: &S) -> Option [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/annotation.rs:168:9 [INFO] [stdout] | [INFO] [stdout] 168 | return Err(StamError::OtherError("Can not merge annotations")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 168 - return Err(StamError::OtherError("Can not merge annotations")); [INFO] [stdout] 168 + Err(StamError::OtherError("Can not merge annotations")) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/annotation.rs:368:43 [INFO] [stdout] | [INFO] [stdout] 368 | let target = WrappedSelector::new(&self.as_ref().target(), &self.store()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `self.as_ref().target()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/annotation.rs:368:68 [INFO] [stdout] | [INFO] [stdout] 368 | let target = WrappedSelector::new(&self.as_ref().target(), &self.store()); [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `self.store()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/annotation.rs:370:69 [INFO] [stdout] | [INFO] [stdout] 370 | let wrappeddata = AnnotationDataRefSerializer { annotation: &self }; [INFO] [stdout] | ^^^^^ help: change this to: `self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `builder.target` after checking its variant with `is_none` [INFO] [stdout] --> src/annotation.rs:620:36 [INFO] [stdout] | [INFO] [stdout] 617 | let target: Option = if builder.target.is_none() { [INFO] [stdout] | --------------------------- help: try: `if let Some() = builder.target` [INFO] [stdout] ... [INFO] [stdout] 620 | Some(self.selector(builder.target.unwrap()).map_err(|err| { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/annotation.rs:632:40 [INFO] [stdout] | [INFO] [stdout] 632 | annotation.data.extend(data.into_iter()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/91021ccc790478a1a89c003e7d32b8d155ae6aae/library/core/src/iter/traits/collect.rs:416:17 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 632 - annotation.data.extend(data.into_iter()); [INFO] [stdout] 632 + annotation.data.extend(data); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/annotation.rs:658:1 [INFO] [stdout] | [INFO] [stdout] 658 | / impl Default for ReannotateMode { [INFO] [stdout] 659 | | fn default() -> Self { [INFO] [stdout] 660 | | Self::Add [INFO] [stdout] 661 | | } [INFO] [stdout] 662 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 651 + #[derive(Default)] [INFO] [stdout] 652 | pub enum ReannotateMode { [INFO] [stdout] 653 | /// Replaces all existing data with the new data [INFO] [stdout] 654 | Replace, [INFO] [stdout] 655 | /// Adds the new data to the existing data [INFO] [stdout] 656 ~ #[default] [INFO] [stdout] 657 ~ Add, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Annotation` has a public `len` method, but no `is_empty` method [INFO] [stdout] --> src/annotation.rs:710:5 [INFO] [stdout] | [INFO] [stdout] 710 | pub fn len(&self) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_without_is_empty [INFO] [stdout] = note: `#[warn(clippy::len_without_is_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the impl [INFO] [stdout] --> src/annotationdata.rs:74:6 [INFO] [stdout] | [INFO] [stdout] 74 | impl<'a> Request for AnnotationDataHandle { [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'store [INFO] [stdout] --> src/annotationdata.rs:75:18 [INFO] [stdout] | [INFO] [stdout] 75 | fn to_handle<'store, S>(&self, _store: &'store S) -> Option [INFO] [stdout] | ^^^^^^ ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 75 - fn to_handle<'store, S>(&self, _store: &'store S) -> Option [INFO] [stdout] 75 + fn to_handle(&self, _store: &S) -> Option [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Some` variant of the iterator element is used [INFO] [stdout] --> src/annotationdata.rs:214:9 [INFO] [stdout] | [INFO] [stdout] 214 | / for data in self.store.iter() { [INFO] [stdout] 215 | | if let Some(data) = data { [INFO] [stdout] 216 | | seq.serialize_element(&ResultItem::new_partial(data, self.parent))?; [INFO] [stdout] 217 | | } [INFO] [stdout] 218 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/annotationdata.rs:215:13 [INFO] [stdout] | [INFO] [stdout] 215 | / if let Some(data) = data { [INFO] [stdout] 216 | | seq.serialize_element(&ResultItem::new_partial(data, self.parent))?; [INFO] [stdout] 217 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] = note: `#[warn(clippy::manual_flatten)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 214 ~ for data in self.store.iter().flatten() { [INFO] [stdout] 215 + seq.serialize_element(&ResultItem::new_partial(data, self.parent))?; [INFO] [stdout] 216 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> tests/api.rs:11:28 [INFO] [stdout] | [INFO] [stdout] 11 | const CARGO_MANIFEST_DIR: &'static str = env!("CARGO_MANIFEST_DIR"); [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] = note: `#[warn(clippy::redundant_static_lifetimes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the impl [INFO] [stdout] --> src/annotationdataset.rs:105:6 [INFO] [stdout] | [INFO] [stdout] 105 | impl<'a> Request for AnnotationDataSetHandle { [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'store [INFO] [stdout] --> src/annotationdataset.rs:106:18 [INFO] [stdout] | [INFO] [stdout] 106 | fn to_handle<'store, S>(&self, _store: &'store S) -> Option [INFO] [stdout] | ^^^^^^ ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 106 - fn to_handle<'store, S>(&self, _store: &'store S) -> Option [INFO] [stdout] 106 + fn to_handle(&self, _store: &S) -> Option [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the impl [INFO] [stdout] --> src/annotationdataset.rs:113:6 [INFO] [stdout] | [INFO] [stdout] 113 | impl<'a> Request for Option { [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'store [INFO] [stdout] --> src/annotationdataset.rs:114:18 [INFO] [stdout] | [INFO] [stdout] 114 | fn to_handle<'store, S>(&self, _store: &'store S) -> Option [INFO] [stdout] | ^^^^^^ ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 114 - fn to_handle<'store, S>(&self, _store: &'store S) -> Option [INFO] [stdout] 114 + fn to_handle(&self, _store: &S) -> Option [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> tests/api.rs:445:19 [INFO] [stdout] | [INFO] [stdout] 445 | const EXAMPLE_3: &'static str = r#"{ [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> tests/api.rs:497:27 [INFO] [stdout] | [INFO] [stdout] 497 | const EXAMPLE_3_TEMP_ID: &'static str = r#"{ [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Some` variant of the iterator element is used [INFO] [stdout] --> src/annotationdataset.rs:179:9 [INFO] [stdout] | [INFO] [stdout] 179 | / for key in other.keys { [INFO] [stdout] 180 | | if let Some(key) = key { [INFO] [stdout] 181 | | self.insert(key.unbind())?; [INFO] [stdout] 182 | | } [INFO] [stdout] 183 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/annotationdataset.rs:180:13 [INFO] [stdout] | [INFO] [stdout] 180 | / if let Some(key) = key { [INFO] [stdout] 181 | | self.insert(key.unbind())?; [INFO] [stdout] 182 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 179 ~ for key in other.keys.into_iter().flatten() { [INFO] [stdout] 180 + self.insert(key.unbind())?; [INFO] [stdout] 181 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Some` variant of the iterator element is used [INFO] [stdout] --> src/annotationdataset.rs:184:9 [INFO] [stdout] | [INFO] [stdout] 184 | / for data in other.data { [INFO] [stdout] 185 | | if let Some(data) = data { [INFO] [stdout] 186 | | self.insert(data.unbind())?; [INFO] [stdout] 187 | | } [INFO] [stdout] 188 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/annotationdataset.rs:185:13 [INFO] [stdout] | [INFO] [stdout] 185 | / if let Some(data) = data { [INFO] [stdout] 186 | | self.insert(data.unbind())?; [INFO] [stdout] 187 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 184 ~ for data in other.data.into_iter().flatten() { [INFO] [stdout] 185 + self.insert(data.unbind())?; [INFO] [stdout] 186 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.as_ref().map(|x| x.as_str())` on an `Option` value [INFO] [stdout] --> src/annotationdataset.rs:257:9 [INFO] [stdout] | [INFO] [stdout] 257 | self.filename.as_ref().map(|x| x.as_str()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using as_deref: `self.filename.as_deref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_as_ref_deref [INFO] [stdout] = note: `#[warn(clippy::option_as_ref_deref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `self.filename` after checking its variant with `is_some` [INFO] [stdout] --> src/annotationdataset.rs:337:28 [INFO] [stdout] | [INFO] [stdout] 336 | if self.filename.is_some() && self.config.serialize_mode() == SerializeMode::AllowInclude { [INFO] [stdout] | ----------------------- the check is happening here [INFO] [stdout] 337 | let filename = self.filename.as_ref().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/annotationdataset.rs:338:34 [INFO] [stdout] | [INFO] [stdout] 338 | if self.id() != Some(&filename) { [INFO] [stdout] | ^^^^^^^^^ help: change this to: `filename` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/annotationdataset.rs:520:33 [INFO] [stdout] | [INFO] [stdout] 520 | debug(self.config(), || format!("AnnotationDataSet.with_data")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"AnnotationDataSet.with_data".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/annotationdataset.rs:532:33 [INFO] [stdout] | [INFO] [stdout] 532 | debug(self.config(), || format!("AnnotationDataSet.with_data")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"AnnotationDataSet.with_data".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary map of the identity function [INFO] [stdout] --> src/annotationdataset.rs:544:54 [INFO] [stdout] | [INFO] [stdout] 544 | let datakey: Option<&DataKey> = self.key(key).map(|key| key); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: remove the call to `map` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_identity [INFO] [stdout] = note: `#[warn(clippy::map_identity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary map of the identity function [INFO] [stdout] --> src/annotationdataset.rs:666:22 [INFO] [stdout] | [INFO] [stdout] 666 | self.get(key).map(|x| x).ok() [INFO] [stdout] | ^^^^^^^^^^^ help: remove the call to `map` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_identity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Some` variant of the iterator element is used [INFO] [stdout] --> src/annotationdataset.rs:718:9 [INFO] [stdout] | [INFO] [stdout] 718 | / for data in self.data.iter_mut() { [INFO] [stdout] 719 | | if let Some(data) = data { [INFO] [stdout] 720 | | data.id = None; [INFO] [stdout] 721 | | } [INFO] [stdout] 722 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/annotationdataset.rs:719:13 [INFO] [stdout] | [INFO] [stdout] 719 | / if let Some(data) = data { [INFO] [stdout] 720 | | data.id = None; [INFO] [stdout] 721 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 718 ~ for data in self.data.iter_mut().flatten() { [INFO] [stdout] 719 + data.id = None; [INFO] [stdout] 720 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/annotationdataset.rs:859:22 [INFO] [stdout] | [INFO] [stdout] 859 | dataset: &mut self.dataset, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: change this to: `self.dataset` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/annotationdataset.rs:923:21 [INFO] [stdout] | [INFO] [stdout] 923 | let _value: Self::Value = map.next_value()?; //read and discard the value [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] = note: `#[warn(clippy::let_unit_value)]` on by default [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 923 - let _value: Self::Value = map.next_value()?; //read and discard the value [INFO] [stdout] 923 + map.next_value()?; //read and discard the value [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/annotationstore.rs:331:13 [INFO] [stdout] | [INFO] [stdout] 331 | format!("StoreFor.inserted: Indexing annotation") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"StoreFor.inserted: Indexing annotation".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/annotationstore.rs:418:25 [INFO] [stdout] | [INFO] [stdout] 418 | / if self.config.annotation_annotation_map { [INFO] [stdout] 419 | | target_annotations.push((*a_handle, handle)); [INFO] [stdout] 420 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 417 ~ Selector::AnnotationSelector(a_handle, None) [INFO] [stdout] 418 ~ if self.config.annotation_annotation_map => { [INFO] [stdout] 419 | target_annotations.push((*a_handle, handle)); [INFO] [stdout] 420 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/annotationstore.rs:423:25 [INFO] [stdout] | [INFO] [stdout] 423 | / if self.config.textrelationmap { [INFO] [stdout] 424 | | extend_textrelationmap.push((*res_handle, *tsel_handle, handle)); [INFO] [stdout] 425 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 422 ~ Selector::TextSelector(res_handle, tsel_handle, _) [INFO] [stdout] 423 ~ if self.config.textrelationmap => { [INFO] [stdout] 424 | extend_textrelationmap.push((*res_handle, *tsel_handle, handle)); [INFO] [stdout] 425 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/annotationstore.rs:428:25 [INFO] [stdout] | [INFO] [stdout] 428 | / if self.config.resource_annotation_metamap { [INFO] [stdout] 429 | | target_meta_resources.push((*res_handle, handle)); [INFO] [stdout] 430 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 427 ~ Selector::ResourceSelector(res_handle) [INFO] [stdout] 428 ~ if self.config.resource_annotation_metamap => { [INFO] [stdout] 429 | target_meta_resources.push((*res_handle, handle)); [INFO] [stdout] 430 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/annotationstore.rs:433:25 [INFO] [stdout] | [INFO] [stdout] 433 | / if self.config.dataset_annotation_metamap { [INFO] [stdout] 434 | | target_meta_datasets.push((*set_handle, handle)); [INFO] [stdout] 435 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 432 ~ Selector::DataSetSelector(set_handle) [INFO] [stdout] 433 ~ if self.config.dataset_annotation_metamap => { [INFO] [stdout] 434 | target_meta_datasets.push((*set_handle, handle)); [INFO] [stdout] 435 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/annotationstore.rs:438:25 [INFO] [stdout] | [INFO] [stdout] 438 | / if self.config.key_annotation_metamap { [INFO] [stdout] 439 | | target_meta_keys.push((*set_handle, *key_handle, handle)); [INFO] [stdout] 440 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 437 ~ Selector::DataKeySelector(set_handle, key_handle) [INFO] [stdout] 438 ~ if self.config.key_annotation_metamap => { [INFO] [stdout] 439 | target_meta_keys.push((*set_handle, *key_handle, handle)); [INFO] [stdout] 440 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/annotationstore.rs:443:25 [INFO] [stdout] | [INFO] [stdout] 443 | / if self.config.data_annotation_metamap { [INFO] [stdout] 444 | | target_meta_data.push((*set_handle, *data_handle, handle)); [INFO] [stdout] 445 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 442 ~ Selector::AnnotationDataSelector(set_handle, data_handle) [INFO] [stdout] 443 ~ if self.config.data_annotation_metamap => { [INFO] [stdout] 444 | target_meta_data.push((*set_handle, *data_handle, handle)); [INFO] [stdout] 445 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/annotationstore.rs:453:29 [INFO] [stdout] | [INFO] [stdout] 453 | .extend(target_annotations.into_iter()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/91021ccc790478a1a89c003e7d32b8d155ae6aae/library/core/src/iter/traits/collect.rs:416:17 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 453 - .extend(target_annotations.into_iter()); [INFO] [stdout] 453 + .extend(target_annotations); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/annotationstore.rs:458:29 [INFO] [stdout] | [INFO] [stdout] 458 | .extend(target_meta_resources.into_iter()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/91021ccc790478a1a89c003e7d32b8d155ae6aae/library/core/src/iter/traits/collect.rs:416:17 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 458 - .extend(target_meta_resources.into_iter()); [INFO] [stdout] 458 + .extend(target_meta_resources); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/annotationstore.rs:463:29 [INFO] [stdout] | [INFO] [stdout] 463 | .extend(target_meta_datasets.into_iter()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/91021ccc790478a1a89c003e7d32b8d155ae6aae/library/core/src/iter/traits/collect.rs:416:17 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 463 - .extend(target_meta_datasets.into_iter()); [INFO] [stdout] 463 + .extend(target_meta_datasets); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/annotationstore.rs:468:29 [INFO] [stdout] | [INFO] [stdout] 468 | .extend(target_meta_keys.into_iter()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/91021ccc790478a1a89c003e7d32b8d155ae6aae/library/core/src/iter/traits/collect.rs:416:17 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 468 - .extend(target_meta_keys.into_iter()); [INFO] [stdout] 468 + .extend(target_meta_keys); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/annotationstore.rs:473:29 [INFO] [stdout] | [INFO] [stdout] 473 | .extend(target_meta_data.into_iter()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/91021ccc790478a1a89c003e7d32b8d155ae6aae/library/core/src/iter/traits/collect.rs:416:17 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 473 - .extend(target_meta_data.into_iter()); [INFO] [stdout] 473 + .extend(target_meta_data); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/annotationstore.rs:479:29 [INFO] [stdout] | [INFO] [stdout] 479 | .extend(extend_textrelationmap.into_iter()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/91021ccc790478a1a89c003e7d32b8d155ae6aae/library/core/src/iter/traits/collect.rs:416:17 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 479 - .extend(extend_textrelationmap.into_iter()); [INFO] [stdout] 479 + .extend(extend_textrelationmap); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/annotationstore.rs:523:17 [INFO] [stdout] | [INFO] [stdout] 523 | / if let Some(ts_handle) = textselection.handle() { [INFO] [stdout] 524 | | Some((textselection.resource().handle(), ts_handle)) [INFO] [stdout] 525 | | } else { [INFO] [stdout] 526 | | None [INFO] [stdout] 527 | | } [INFO] [stdout] | |_________________^ help: try: `textselection.handle().map(|ts_handle| (textselection.resource().handle(), ts_handle))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead [INFO] [stdout] --> src/annotationstore.rs:683:21 [INFO] [stdout] | [INFO] [stdout] 683 | / >::iter(self) [INFO] [stdout] 684 | | .filter(|substore| substore.parents.contains(&None)) [INFO] [stdout] 685 | | .next() [INFO] [stdout] | |_______________________________^ help: try: `>::iter(self).find(|substore| substore.parents.contains(&None))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next [INFO] [stdout] = note: `#[warn(clippy::filter_next)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Some` variant of the iterator element is used [INFO] [stdout] --> src/annotationstore.rs:730:9 [INFO] [stdout] | [INFO] [stdout] 730 | / for annotation in self.store.iter() { [INFO] [stdout] 731 | | if let Some(annotation) = annotation { [INFO] [stdout] 732 | | if self [INFO] [stdout] 733 | | .parent [INFO] [stdout] ... | [INFO] [stdout] 742 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/annotationstore.rs:731:13 [INFO] [stdout] | [INFO] [stdout] 731 | / if let Some(annotation) = annotation { [INFO] [stdout] 732 | | if self [INFO] [stdout] 733 | | .parent [INFO] [stdout] 734 | | .annotation_substore_map [INFO] [stdout] ... | [INFO] [stdout] 741 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 730 ~ for annotation in self.store.iter().flatten() { [INFO] [stdout] 731 + if self [INFO] [stdout] 732 + .parent [INFO] [stdout] 733 + .annotation_substore_map [INFO] [stdout] 734 + .get(annotation.handle().expect("annotation must have handle")) [INFO] [stdout] 735 + == self.substore [INFO] [stdout] 736 + //output the selected substore (or main store) only [INFO] [stdout] 737 + { [INFO] [stdout] 738 + seq.serialize_element(&annotation.as_resultitem(self.parent, self.parent))?; [INFO] [stdout] 739 + } [INFO] [stdout] 740 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Some` variant of the iterator element is used [INFO] [stdout] --> src/annotationstore.rs:753:9 [INFO] [stdout] | [INFO] [stdout] 753 | / for resource in self.store.iter() { [INFO] [stdout] 754 | | if let Some(resource) = resource { [INFO] [stdout] 755 | | let found_substores = self [INFO] [stdout] 756 | | .parent [INFO] [stdout] ... | [INFO] [stdout] 768 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/annotationstore.rs:754:13 [INFO] [stdout] | [INFO] [stdout] 754 | / if let Some(resource) = resource { [INFO] [stdout] 755 | | let found_substores = self [INFO] [stdout] 756 | | .parent [INFO] [stdout] 757 | | .resource_substore_map [INFO] [stdout] ... | [INFO] [stdout] 767 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 753 ~ for resource in self.store.iter().flatten() { [INFO] [stdout] 754 + let found_substores = self [INFO] [stdout] 755 + .parent [INFO] [stdout] 756 + .resource_substore_map [INFO] [stdout] 757 + .get(resource.handle().expect("resource must have handle")); [INFO] [stdout] 758 + if (found_substores.is_none() && self.substore.is_none()) [INFO] [stdout] 759 + || (found_substores.is_some() [INFO] [stdout] 760 + && self.substore.is_some() [INFO] [stdout] 761 + && found_substores.unwrap().contains(&self.substore.unwrap())) [INFO] [stdout] 762 + //output the selected substore (or main store) only [INFO] [stdout] 763 + { [INFO] [stdout] 764 + seq.serialize_element(resource)?; [INFO] [stdout] 765 + } [INFO] [stdout] 766 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Some` variant of the iterator element is used [INFO] [stdout] --> src/annotationstore.rs:779:9 [INFO] [stdout] | [INFO] [stdout] 779 | / for dataset in self.store.iter() { [INFO] [stdout] 780 | | if let Some(dataset) = dataset { [INFO] [stdout] 781 | | let found_substores = self [INFO] [stdout] 782 | | .parent [INFO] [stdout] ... | [INFO] [stdout] 794 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/annotationstore.rs:780:13 [INFO] [stdout] | [INFO] [stdout] 780 | / if let Some(dataset) = dataset { [INFO] [stdout] 781 | | let found_substores = self [INFO] [stdout] 782 | | .parent [INFO] [stdout] 783 | | .dataset_substore_map [INFO] [stdout] ... | [INFO] [stdout] 793 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 779 ~ for dataset in self.store.iter().flatten() { [INFO] [stdout] 780 + let found_substores = self [INFO] [stdout] 781 + .parent [INFO] [stdout] 782 + .dataset_substore_map [INFO] [stdout] 783 + .get(dataset.handle().expect("dataset must have handle")); [INFO] [stdout] 784 + if (found_substores.is_none() && self.substore.is_none()) [INFO] [stdout] 785 + || (found_substores.is_some() [INFO] [stdout] 786 + && self.substore.is_some() [INFO] [stdout] 787 + && found_substores.unwrap().contains(&self.substore.unwrap())) [INFO] [stdout] 788 + //output the selected substore (or main store) only [INFO] [stdout] 789 + { [INFO] [stdout] 790 + seq.serialize_element(dataset)?; [INFO] [stdout] 791 + } [INFO] [stdout] 792 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.as_ref().map(|v| &**v)` on an `Option` value [INFO] [stdout] --> src/annotationstore.rs:865:36 [INFO] [stdout] | [INFO] [stdout] 865 | get_filepath(filename, new_config.workdir.as_ref().map(|v| &**v))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using as_deref: `new_config.workdir.as_deref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_as_ref_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/annotationstore.rs:1012:15 [INFO] [stdout] | [INFO] [stdout] 1012 | debug(&self.config(), || format!("AnnotationStore::new_config")); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `self.config()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/annotationstore.rs:1012:34 [INFO] [stdout] | [INFO] [stdout] 1012 | debug(&self.config(), || format!("AnnotationStore::new_config")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"AnnotationStore::new_config".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.as_ref().map(|x| x.as_path())` on an `Option` value [INFO] [stdout] --> src/annotationstore.rs:1079:9 [INFO] [stdout] | [INFO] [stdout] 1079 | self.annotations_filename.as_ref().map(|x| x.as_path()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using as_deref: `self.annotations_filename.as_deref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_as_ref_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/annotationstore.rs:1166:70 [INFO] [stdout] | [INFO] [stdout] 1166 | return Err(StamError::SerializationError(format!( [INFO] [stdout] | ______________________________________________________________________^ [INFO] [stdout] 1167 | | "Unable to infer a filename for annotationset. Has neither filename nor ID.", [INFO] [stdout] 1168 | | ))); [INFO] [stdout] | |_____________________^ help: consider using `.to_string()`: `"Unable to infer a filename for annotationset. Has neither filename nor ID.".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/annotationstore.rs:1203:54 [INFO] [stdout] | [INFO] [stdout] 1203 | return Err(StamError::SerializationError(format!( [INFO] [stdout] | ______________________________________________________^ [INFO] [stdout] 1204 | | "Unable to infer a filename for AnnotationStore. Has neither filename nor ID.", [INFO] [stdout] 1205 | | ))); [INFO] [stdout] | |_____________^ help: consider using `.to_string()`: `"Unable to infer a filename for AnnotationStore. Has neither filename nor ID.".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct pattern is not needed for a unit variant [INFO] [stdout] --> src/annotationstore.rs:1253:33 [INFO] [stdout] | [INFO] [stdout] 1253 | DataFormat::CBOR { .. } => { [INFO] [stdout] | ^^^^^^^ help: remove the struct pattern [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unneeded_struct_pattern [INFO] [stdout] = note: `#[warn(clippy::unneeded_struct_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/annotationstore.rs:1300:13 [INFO] [stdout] | [INFO] [stdout] 1300 | format!("AnnotationStore::propagate_full_config()") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"AnnotationStore::propagate_full_config()".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/annotationstore.rs:1617:25 [INFO] [stdout] | [INFO] [stdout] 1617 | / if res == res2 && tsel2.as_usize() == tsel.as_usize() + 1 { [INFO] [stdout] 1618 | | substitute = Some(Selector::RangedTextSelector { [INFO] [stdout] 1619 | | resource: *res, [INFO] [stdout] 1620 | | begin: *tsel, [INFO] [stdout] 1621 | | end: *tsel2, [INFO] [stdout] 1622 | | }); [INFO] [stdout] 1623 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1616 ~ ) [INFO] [stdout] 1617 ~ if res == res2 && tsel2.as_usize() == tsel.as_usize() + 1 => { [INFO] [stdout] 1618 | substitute = Some(Selector::RangedTextSelector { [INFO] [stdout] ... [INFO] [stdout] 1622 | }); [INFO] [stdout] 1623 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/annotationstore.rs:1633:25 [INFO] [stdout] | [INFO] [stdout] 1633 | / if resource == res2 && tsel2.as_usize() == end.as_usize() + 1 { [INFO] [stdout] 1634 | | substitute = Some(Selector::RangedTextSelector { [INFO] [stdout] 1635 | | resource: *resource, [INFO] [stdout] 1636 | | begin: *begin, [INFO] [stdout] 1637 | | end: *tsel2, [INFO] [stdout] 1638 | | }); [INFO] [stdout] 1639 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1632 ~ ) [INFO] [stdout] 1633 ~ if resource == res2 && tsel2.as_usize() == end.as_usize() + 1 => { [INFO] [stdout] 1634 | substitute = Some(Selector::RangedTextSelector { [INFO] [stdout] ... [INFO] [stdout] 1638 | }); [INFO] [stdout] 1639 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/annotationstore.rs:1645:25 [INFO] [stdout] | [INFO] [stdout] 1645 | / if annotation2.as_usize() == annotation.as_usize() + 1 { [INFO] [stdout] 1646 | | substitute = Some(Selector::RangedAnnotationSelector { [INFO] [stdout] 1647 | | begin: *annotation, [INFO] [stdout] 1648 | | end: *annotation2, [INFO] [stdout] 1649 | | with_text: false, [INFO] [stdout] 1650 | | }); [INFO] [stdout] 1651 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1644 ~ ) [INFO] [stdout] 1645 ~ if annotation2.as_usize() == annotation.as_usize() + 1 => { [INFO] [stdout] 1646 | substitute = Some(Selector::RangedAnnotationSelector { [INFO] [stdout] ... [INFO] [stdout] 1650 | }); [INFO] [stdout] 1651 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/annotationstore.rs:1661:25 [INFO] [stdout] | [INFO] [stdout] 1661 | / if annotation.as_usize() == end.as_usize() + 1 { [INFO] [stdout] 1662 | | substitute = Some(Selector::RangedAnnotationSelector { [INFO] [stdout] 1663 | | begin: *begin, [INFO] [stdout] 1664 | | end: *annotation, [INFO] [stdout] 1665 | | with_text: false, [INFO] [stdout] 1666 | | }); [INFO] [stdout] 1667 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1660 ~ ) [INFO] [stdout] 1661 ~ if annotation.as_usize() == end.as_usize() + 1 => { [INFO] [stdout] 1662 | substitute = Some(Selector::RangedAnnotationSelector { [INFO] [stdout] ... [INFO] [stdout] 1666 | }); [INFO] [stdout] 1667 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/annotationstore.rs:1673:25 [INFO] [stdout] | [INFO] [stdout] 1673 | / ... if annotation2.as_usize() == annotation.as_usize() + 1 { [INFO] [stdout] 1674 | | ... //we can only merge annotations that reference the entire underlying annotation's text and not a subpart of it [INFO] [stdout] 1675 | | ... if let (Some(offset), Some(offset2)) = ( [INFO] [stdout] 1676 | | ... last.offset_with_mode(self, Some(OffsetMode::BeginEnd)), [INFO] [stdout] ... | [INFO] [stdout] 1691 | | ... } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1672 ~ ) [INFO] [stdout] 1673 ~ if annotation2.as_usize() == annotation.as_usize() + 1 => { [INFO] [stdout] 1674 | //we can only merge annotations that reference the entire underlying annotation's text and not a subpart of it [INFO] [stdout] ... [INFO] [stdout] 1690 | } [INFO] [stdout] 1691 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/annotationstore.rs:1701:25 [INFO] [stdout] | [INFO] [stdout] 1701 | / ... if annotation.as_usize() == end.as_usize() + 1 { [INFO] [stdout] 1702 | | ... //we can only merge annotations that reference the entire underlying annotation's text and not a subpart of it [INFO] [stdout] 1703 | | ... if let Some(offset) = [INFO] [stdout] 1704 | | ... selector.offset_with_mode(self, Some(OffsetMode::BeginEnd)) [INFO] [stdout] ... | [INFO] [stdout] 1716 | | ... } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1700 ~ ) [INFO] [stdout] 1701 ~ if annotation.as_usize() == end.as_usize() + 1 => { [INFO] [stdout] 1702 | //we can only merge annotations that reference the entire underlying annotation's text and not a subpart of it [INFO] [stdout] ... [INFO] [stdout] 1715 | } [INFO] [stdout] 1716 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'store [INFO] [stdout] --> src/annotationstore.rs:1733:46 [INFO] [stdout] | [INFO] [stdout] 1733 | pub(crate) fn textselections_by_selector<'store>( [INFO] [stdout] | ^^^^^^ [INFO] [stdout] 1734 | &'store self, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 1733 ~ pub(crate) fn textselections_by_selector( [INFO] [stdout] 1734 ~ &self, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/annotationstore.rs:1777:36 [INFO] [stdout] | [INFO] [stdout] 1777 | results.extend(self.textselections_by_selector(subselector).into_iter()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/91021ccc790478a1a89c003e7d32b8d155ae6aae/library/core/src/iter/traits/collect.rs:416:17 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 1777 - results.extend(self.textselections_by_selector(subselector).into_iter()) [INFO] [stdout] 1777 + results.extend(self.textselections_by_selector(subselector)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/annotationstore.rs:1799:10 [INFO] [stdout] | [INFO] [stdout] 1799 | ) -> ( [INFO] [stdout] | __________^ [INFO] [stdout] 1800 | | usize, [INFO] [stdout] 1801 | | usize, [INFO] [stdout] 1802 | | usize, [INFO] [stdout] ... | [INFO] [stdout] 1813 | | usize, [INFO] [stdout] 1814 | | ) { [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/annotationstore.rs:1869:10 [INFO] [stdout] | [INFO] [stdout] 1869 | ) -> ( [INFO] [stdout] | __________^ [INFO] [stdout] 1870 | | usize, [INFO] [stdout] 1871 | | usize, [INFO] [stdout] 1872 | | usize, [INFO] [stdout] ... | [INFO] [stdout] 1883 | | usize, [INFO] [stdout] 1884 | | ) { [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Some` variant of the iterator element is used [INFO] [stdout] --> src/annotationstore.rs:1920:13 [INFO] [stdout] | [INFO] [stdout] 1920 | / for resource in self.resources.iter_mut() { [INFO] [stdout] 1921 | | if let Some(resource) = resource { [INFO] [stdout] 1922 | | resource.shrink_to_fit(); [INFO] [stdout] 1923 | | } [INFO] [stdout] 1924 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/annotationstore.rs:1921:17 [INFO] [stdout] | [INFO] [stdout] 1921 | / if let Some(resource) = resource { [INFO] [stdout] 1922 | | resource.shrink_to_fit(); [INFO] [stdout] 1923 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1920 ~ for resource in self.resources.iter_mut().flatten() { [INFO] [stdout] 1921 + resource.shrink_to_fit(); [INFO] [stdout] 1922 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Some` variant of the iterator element is used [INFO] [stdout] --> src/annotationstore.rs:1925:13 [INFO] [stdout] | [INFO] [stdout] 1925 | / for annotationset in self.annotationsets.iter_mut() { [INFO] [stdout] 1926 | | if let Some(annotationset) = annotationset { [INFO] [stdout] 1927 | | annotationset.shrink_to_fit(); [INFO] [stdout] 1928 | | } [INFO] [stdout] 1929 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/annotationstore.rs:1926:17 [INFO] [stdout] | [INFO] [stdout] 1926 | / if let Some(annotationset) = annotationset { [INFO] [stdout] 1927 | | annotationset.shrink_to_fit(); [INFO] [stdout] 1928 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1925 ~ for annotationset in self.annotationsets.iter_mut().flatten() { [INFO] [stdout] 1926 + annotationset.shrink_to_fit(); [INFO] [stdout] 1927 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Some` variant of the iterator element is used [INFO] [stdout] --> src/annotationstore.rs:1997:9 [INFO] [stdout] | [INFO] [stdout] 1997 | / for annotation in self.annotations.iter_mut() { [INFO] [stdout] 1998 | | if let Some(annotation) = annotation { [INFO] [stdout] 1999 | | annotation.id = None; [INFO] [stdout] 2000 | | } [INFO] [stdout] 2001 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/annotationstore.rs:1998:13 [INFO] [stdout] | [INFO] [stdout] 1998 | / if let Some(annotation) = annotation { [INFO] [stdout] 1999 | | annotation.id = None; [INFO] [stdout] 2000 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1997 ~ for annotation in self.annotations.iter_mut().flatten() { [INFO] [stdout] 1998 + annotation.id = None; [INFO] [stdout] 1999 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Some` variant of the iterator element is used [INFO] [stdout] --> src/annotationstore.rs:2009:9 [INFO] [stdout] | [INFO] [stdout] 2009 | / for annotationset in self.annotationsets.iter_mut() { [INFO] [stdout] 2010 | | if let Some(annotationset) = annotationset { [INFO] [stdout] 2011 | | annotationset.strip_data_ids(); [INFO] [stdout] 2012 | | } [INFO] [stdout] 2013 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/annotationstore.rs:2010:13 [INFO] [stdout] | [INFO] [stdout] 2010 | / if let Some(annotationset) = annotationset { [INFO] [stdout] 2011 | | annotationset.strip_data_ids(); [INFO] [stdout] 2012 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 2009 ~ for annotationset in self.annotationsets.iter_mut().flatten() { [INFO] [stdout] 2010 + annotationset.strip_data_ids(); [INFO] [stdout] 2011 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/annotationstore.rs:2153:21 [INFO] [stdout] | [INFO] [stdout] 2153 | format!("AnnotationStore.set_filename: Changing dataformat to JSON") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"AnnotationStore.set_filename: Changing dataformat to JSON".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/annotationstore.rs:2163:17 [INFO] [stdout] | [INFO] [stdout] 2163 | format!("AnnotationStore.set_filename: Changing dataformat to CSV") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"AnnotationStore.set_filename: Changing dataformat to CSV".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/annotationstore.rs:2171:17 [INFO] [stdout] | [INFO] [stdout] 2171 | format!("AnnotationStore.set_filename: Changing dataformat to CBOR") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"AnnotationStore.set_filename: Changing dataformat to CBOR".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/annotationstore.rs:2197:9 [INFO] [stdout] | [INFO] [stdout] 2197 | / if let Some(textselection_annotationmap) = [INFO] [stdout] 2198 | | self.textrelationmap.data.get(resource_handle.as_usize()) [INFO] [stdout] 2199 | | { [INFO] [stdout] 2200 | | Some( [INFO] [stdout] ... | [INFO] [stdout] 2207 | | None [INFO] [stdout] 2208 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 2197 ~ self.textrelationmap.data.get(resource_handle.as_usize()).map(|textselection_annotationmap| textselection_annotationmap [INFO] [stdout] 2198 + .data [INFO] [stdout] 2199 + .iter() [INFO] [stdout] 2200 + .flat_map(|v| v.iter().copied())) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/annotationstore.rs:2257:9 [INFO] [stdout] | [INFO] [stdout] 2257 | if let Some(resource) = self.get(resource_handle).ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] = note: `#[warn(clippy::match_result_ok)]` on by default [INFO] [stdout] help: consider matching on `Ok(resource)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 2257 - if let Some(resource) = self.get(resource_handle).ok() { [INFO] [stdout] 2257 + if let Ok(resource) = self.get(resource_handle) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/annotationstore.rs:2258:82 [INFO] [stdout] | [INFO] [stdout] 2258 | if let Ok(Some(textselection_handle)) = resource.known_textselection(&offset) { [INFO] [stdout] | ^^^^^^^ help: change this to: `offset` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/annotationstore.rs:2394:20 [INFO] [stdout] | [INFO] [stdout] 2394 | store: &mut self.store, [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: change this to: `self.store` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/annotationstore.rs:2453:87 [INFO] [stdout] | [INFO] [stdout] 2453 | ... return Err(::custom(format!( [INFO] [stdout] | _________________________________________________________________________^ [INFO] [stdout] 2454 | | ... "Expected string elements inside @include array in AnnotationStore, got something else" [INFO] [stdout] 2455 | | ... ))); [INFO] [stdout] | |_______________________^ help: consider using `.to_string()`: `"Expected string elements inside @include array in AnnotationStore, got something else".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/annotationstore.rs:2461:79 [INFO] [stdout] | [INFO] [stdout] 2461 | ... return Err(::custom(format!( [INFO] [stdout] | _________________________________________________________________________^ [INFO] [stdout] 2462 | | ... "Expected string or array for @include in AnnotationStore, got something else" [INFO] [stdout] 2463 | | ... ))); [INFO] [stdout] | |_______________________^ help: consider using `.to_string()`: `"Expected string or array for @include in AnnotationStore, got something else".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/annotationstore.rs:2491:21 [INFO] [stdout] | [INFO] [stdout] 2491 | let _value: Self::Value = map.next_value()?; //read and discard the value [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 2491 - let _value: Self::Value = map.next_value()?; //read and discard the value [INFO] [stdout] 2491 + map.next_value()?; //read and discard the value [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `while let` loop [INFO] [stdout] --> src/annotationstore.rs:2625:9 [INFO] [stdout] | [INFO] [stdout] 2625 | / loop { [INFO] [stdout] 2626 | | if let Some(resource) = [INFO] [stdout] 2627 | | seq.next_element_seed(DeserializeTextResource::new(self.store.new_config()))? [INFO] [stdout] ... | [INFO] [stdout] 2652 | | } [INFO] [stdout] | |_________^ help: try: `while let Some(resource) = seq.next_element_seed(DeserializeTextResource::new(self.store.new_config()))? { .. }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_loop [INFO] [stdout] = note: `#[warn(clippy::while_let_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/annotation.rs:128:40 [INFO] [stdout] | [INFO] [stdout] 128 | Handles::new(Cow::Borrowed(&annotations), true, self.store()) [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `annotations` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/api/annotation.rs:306:33 [INFO] [stdout] | [INFO] [stdout] 306 | .or_insert_with(move || Vec::new()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Vec::new` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: iterating on a map's values [INFO] [stdout] --> src/api/annotation.rs:309:9 [INFO] [stdout] | [INFO] [stdout] 309 | map.into_iter().map(|(_, v)| v.into_iter().collect()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.into_values().map(|v| v.into_iter().collect())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map [INFO] [stdout] = note: `#[warn(clippy::iter_kv_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/annotation.rs:413:14 [INFO] [stdout] | [INFO] [stdout] 413 | .map(|annotation| annotation.annotations()) [INFO] [stdout] | ______________^ [INFO] [stdout] 414 | | .flatten() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|annotation| annotation.annotations())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] = note: `#[warn(clippy::map_flatten)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/annotation.rs:431:18 [INFO] [stdout] | [INFO] [stdout] 431 | self.map(|annotation| annotation.annotations()).flatten(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|annotation| annotation.annotations())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/annotation.rs:443:14 [INFO] [stdout] | [INFO] [stdout] 443 | .map(|annotation| annotation.annotations_in_targets(depth)) [INFO] [stdout] | ______________^ [INFO] [stdout] 444 | | .flatten() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|annotation| annotation.annotations_in_targets(depth))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/annotation.rs:457:37 [INFO] [stdout] | [INFO] [stdout] 457 | let mut data: Vec<_> = self.map(|annotation| annotation.data()).flatten().collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|annotation| annotation.data())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/annotation.rs:471:18 [INFO] [stdout] | [INFO] [stdout] 471 | self.map(|annotation| annotation.data()).flatten(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|annotation| annotation.data())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/annotation.rs:480:14 [INFO] [stdout] | [INFO] [stdout] 480 | .map(|annotation| annotation.data_as_metadata()) [INFO] [stdout] | ______________^ [INFO] [stdout] 481 | | .flatten() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|annotation| annotation.data_as_metadata())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/annotation.rs:490:37 [INFO] [stdout] | [INFO] [stdout] 490 | let mut keys: Vec<_> = self.map(|annotation| annotation.keys()).flatten().collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|annotation| annotation.keys())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/annotation.rs:501:14 [INFO] [stdout] | [INFO] [stdout] 501 | .map(|annotation| annotation.keys_as_metadata()) [INFO] [stdout] | ______________^ [INFO] [stdout] 502 | | .flatten() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|annotation| annotation.keys_as_metadata())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: mutable key type [INFO] [stdout] --> src/api/annotation.rs:521:9 [INFO] [stdout] | [INFO] [stdout] 521 | / let collection: BTreeSet<_> = self [INFO] [stdout] 522 | | .map(|annotation| annotation.resources_as_metadata()) [INFO] [stdout] 523 | | .flatten() [INFO] [stdout] 524 | | .collect(); [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = note: ... because it contains `ResultItem<'_, TextResource>`, which has interior mutability [INFO] [stdout] = note: ... because it contains `&TextResource`, which has interior mutability [INFO] [stdout] = note: ... because it contains `TextResource`, which has interior mutability [INFO] [stdout] = note: ... because it contains `Arc>`, which has interior mutability [INFO] [stdout] = note: ... because it contains `RwLock`, which has interior mutability [INFO] [stdout] = note: ... because it contains `RwLock`, which has interior mutability [INFO] [stdout] = note: ... because it contains `Atomic`, which has interior mutability [INFO] [stdout] = note: ... because it contains `UnsafeCell<::Storage>`, which has interior mutability [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mutable_key_type [INFO] [stdout] = note: `#[warn(clippy::mutable_key_type)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/annotation.rs:522:14 [INFO] [stdout] | [INFO] [stdout] 522 | .map(|annotation| annotation.resources_as_metadata()) [INFO] [stdout] | ______________^ [INFO] [stdout] 523 | | .flatten() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|annotation| annotation.resources_as_metadata())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: mutable key type [INFO] [stdout] --> src/api/annotation.rs:533:9 [INFO] [stdout] | [INFO] [stdout] 533 | / let collection: BTreeSet<_> = self [INFO] [stdout] 534 | | .map(|annotation| annotation.resources()) [INFO] [stdout] 535 | | .flatten() [INFO] [stdout] 536 | | .collect(); [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = note: ... because it contains `ResultItem<'_, TextResource>`, which has interior mutability [INFO] [stdout] = note: ... because it contains `&TextResource`, which has interior mutability [INFO] [stdout] = note: ... because it contains `TextResource`, which has interior mutability [INFO] [stdout] = note: ... because it contains `Arc>`, which has interior mutability [INFO] [stdout] = note: ... because it contains `RwLock`, which has interior mutability [INFO] [stdout] = note: ... because it contains `RwLock`, which has interior mutability [INFO] [stdout] = note: ... because it contains `Atomic`, which has interior mutability [INFO] [stdout] = note: ... because it contains `UnsafeCell<::Storage>`, which has interior mutability [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mutable_key_type [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/annotation.rs:534:14 [INFO] [stdout] | [INFO] [stdout] 534 | .map(|annotation| annotation.resources()) [INFO] [stdout] | ______________^ [INFO] [stdout] 535 | | .flatten() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|annotation| annotation.resources())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/annotation.rs:542:14 [INFO] [stdout] | [INFO] [stdout] 542 | self.map(|annotation| annotation.textselections()) [INFO] [stdout] | ______________^ [INFO] [stdout] 543 | | .flatten() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|annotation| annotation.textselections())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/annotation.rs:557:14 [INFO] [stdout] | [INFO] [stdout] 557 | self.map(|annotation| annotation.related_text(operator)) [INFO] [stdout] | ______________^ [INFO] [stdout] 558 | | .flatten() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|annotation| annotation.related_text(operator))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/annotation.rs:1079:52 [INFO] [stdout] | [INFO] [stdout] 1079 | annotation.data().filter_any_byref(&data).test() [INFO] [stdout] | ^^^^^ help: change this to: `data` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/annotationdata.rs:119:14 [INFO] [stdout] | [INFO] [stdout] 119 | .map(|annotation| annotation.resources_as_metadata()) [INFO] [stdout] | ______________^ [INFO] [stdout] 120 | | .flatten() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|annotation| annotation.resources_as_metadata())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/annotationdata.rs:130:14 [INFO] [stdout] | [INFO] [stdout] 130 | .map(|annotation| annotation.resources()) [INFO] [stdout] | ______________^ [INFO] [stdout] 131 | | .flatten() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|annotation| annotation.resources())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/annotationdata.rs:141:14 [INFO] [stdout] | [INFO] [stdout] 141 | .map(|annotation| annotation.datasets()) [INFO] [stdout] | ______________^ [INFO] [stdout] 142 | | .flatten() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|annotation| annotation.datasets())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/annotationdata.rs:214:44 [INFO] [stdout] | [INFO] [stdout] 214 | let mut annotations: Vec<_> = self.map(|data| data.annotations()).flatten().collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|data| data.annotations())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/annotationdata.rs:230:14 [INFO] [stdout] | [INFO] [stdout] 230 | .map(|data| data.annotations_as_metadata()) [INFO] [stdout] | ______________^ [INFO] [stdout] 231 | | .flatten() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|data| data.annotations_as_metadata())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/annotationdata.rs:426:67 [INFO] [stdout] | [INFO] [stdout] 426 | Filter::DataOperator(operator, _) => data.test(false, &operator), [INFO] [stdout] | ^^^^^^^^^ help: change this to: `operator` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/annotationdata.rs:430:41 [INFO] [stdout] | [INFO] [stdout] 430 | && data.test(false, &operator) [INFO] [stdout] | ^^^^^^^^^ help: change this to: `operator` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'store [INFO] [stdout] --> src/api/annotationstore.rs:220:46 [INFO] [stdout] | [INFO] [stdout] 220 | pub(crate) fn find_data_request_resolver<'store>( [INFO] [stdout] | ^^^^^^ [INFO] [stdout] 221 | &'store self, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 220 ~ pub(crate) fn find_data_request_resolver( [INFO] [stdout] 221 ~ &self, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this block may be rewritten with the `?` operator [INFO] [stdout] --> src/api/annotationstore.rs:233:21 [INFO] [stdout] | [INFO] [stdout] 233 | / if test_key_handle.is_none() { [INFO] [stdout] 234 | | //requested key doesn't exist, bail out early, we won't find anything at all [INFO] [stdout] 235 | | return None; [INFO] [stdout] 236 | | } [INFO] [stdout] | |_____________________^ help: replace it with: `test_key_handle?;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] = note: `#[warn(clippy::question_mark)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/annotationstore.rs:325:22 [INFO] [stdout] | [INFO] [stdout] 325 | .map(move |dataset| { [INFO] [stdout] | ______________________^ [INFO] [stdout] 326 | | dataset.as_ref().data().filter_map(move |annotationdata| { [INFO] [stdout] 327 | | if key_handle.is_none() || key_handle.unwrap() == annotationdata.key() { [INFO] [stdout] 328 | | Some(annotationdata.as_resultitem(dataset.as_ref(), rootstore)) [INFO] [stdout] ... | [INFO] [stdout] 333 | | }) [INFO] [stdout] 334 | | .flatten(), [INFO] [stdout] | |______________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] help: try replacing `map` with `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 325 ~ .flat_map(move |dataset| { [INFO] [stdout] 326 + dataset.as_ref().data().filter_map(move |annotationdata| { [INFO] [stdout] 327 + if key_handle.is_none() || key_handle.unwrap() == annotationdata.key() { [INFO] [stdout] 328 + Some(annotationdata.as_resultitem(dataset.as_ref(), rootstore)) [INFO] [stdout] 329 + } else { [INFO] [stdout] 330 + None [INFO] [stdout] 331 + } [INFO] [stdout] 332 + }) [INFO] [stdout] 333 ~ }), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: mutable key type [INFO] [stdout] --> src/api/annotationstore.rs:359:9 [INFO] [stdout] | [INFO] [stdout] 359 | / let keys: BTreeSet<_> = self [INFO] [stdout] 360 | | .datasets() [INFO] [stdout] 361 | | .map(|dataset| dataset.keys()) [INFO] [stdout] 362 | | .flatten() [INFO] [stdout] 363 | | .collect(); [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = note: ... because it contains `ResultItem<'_, DataKey>`, which has interior mutability [INFO] [stdout] = note: ... because it contains `&::StoreType`, which has interior mutability [INFO] [stdout] = note: ... because it contains `::StoreType`, which has interior mutability [INFO] [stdout] = note: ... because it contains `AnnotationDataSet`, which has interior mutability [INFO] [stdout] = note: ... because it contains `Arc>`, which has interior mutability [INFO] [stdout] = note: ... because it contains `RwLock`, which has interior mutability [INFO] [stdout] = note: ... because it contains `RwLock`, which has interior mutability [INFO] [stdout] = note: ... because it contains `Atomic`, which has interior mutability [INFO] [stdout] = note: ... because it contains `UnsafeCell<::Storage>`, which has interior mutability [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mutable_key_type [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/annotationstore.rs:361:14 [INFO] [stdout] | [INFO] [stdout] 361 | .map(|dataset| dataset.keys()) [INFO] [stdout] | ______________^ [INFO] [stdout] 362 | | .flatten() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|dataset| dataset.keys())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::iter::Map>>, {closure@src/api/annotationstore.rs:409:18: 409:24}>` [INFO] [stdout] --> src/api/annotationstore.rs:408:9 [INFO] [stdout] | [INFO] [stdout] 408 | / self.find_data(set, key, value) [INFO] [stdout] 409 | | .map(|data| { [INFO] [stdout] 410 | | data.resources_as_metadata() [INFO] [stdout] 411 | | .into_iter() [INFO] [stdout] 412 | | .map(move |resource| (resource, data.clone())) [INFO] [stdout] 413 | | }) [INFO] [stdout] 414 | | .into_iter() [INFO] [stdout] | |________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 408 ~ self.find_data(set, key, value) [INFO] [stdout] 409 + .map(|data| { [INFO] [stdout] 410 + data.resources_as_metadata() [INFO] [stdout] 411 + .into_iter() [INFO] [stdout] 412 + .map(move |resource| (resource, data.clone())) [INFO] [stdout] 413 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::collections::btree_set::IntoIter>` [INFO] [stdout] --> src/api/annotationstore.rs:410:17 [INFO] [stdout] | [INFO] [stdout] 410 | / data.resources_as_metadata() [INFO] [stdout] 411 | | .into_iter() [INFO] [stdout] | |________________________________^ help: consider removing `.into_iter()`: `data.resources_as_metadata()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::iter::Map>>, {closure@src/api/annotationstore.rs:441:18: 441:24}>` [INFO] [stdout] --> src/api/annotationstore.rs:440:9 [INFO] [stdout] | [INFO] [stdout] 440 | / self.find_data(set, key, value) [INFO] [stdout] 441 | | .map(|data| { [INFO] [stdout] 442 | | data.datasets() [INFO] [stdout] 443 | | .into_iter() [INFO] [stdout] 444 | | .map(move |dataset| (dataset, data.clone())) [INFO] [stdout] 445 | | }) [INFO] [stdout] 446 | | .into_iter() [INFO] [stdout] | |________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 440 ~ self.find_data(set, key, value) [INFO] [stdout] 441 + .map(|data| { [INFO] [stdout] 442 + data.datasets() [INFO] [stdout] 443 + .into_iter() [INFO] [stdout] 444 + .map(move |dataset| (dataset, data.clone())) [INFO] [stdout] 445 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::collections::btree_set::IntoIter>` [INFO] [stdout] --> src/api/annotationstore.rs:442:17 [INFO] [stdout] | [INFO] [stdout] 442 | / data.datasets() [INFO] [stdout] 443 | | .into_iter() [INFO] [stdout] | |________________________________^ help: consider removing `.into_iter()`: `data.datasets()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: mutable key type [INFO] [stdout] --> src/api/datakey.rs:106:44 [INFO] [stdout] | [INFO] [stdout] 106 | pub fn resources_as_metadata(&self) -> BTreeSet> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: ... because it contains `ResultItem<'store, TextResource>`, which has interior mutability [INFO] [stdout] = note: ... because it contains `&TextResource`, which has interior mutability [INFO] [stdout] = note: ... because it contains `TextResource`, which has interior mutability [INFO] [stdout] = note: ... because it contains `Arc>`, which has interior mutability [INFO] [stdout] = note: ... because it contains `RwLock`, which has interior mutability [INFO] [stdout] = note: ... because it contains `RwLock`, which has interior mutability [INFO] [stdout] = note: ... because it contains `Atomic`, which has interior mutability [INFO] [stdout] = note: ... because it contains `UnsafeCell<::Storage>`, which has interior mutability [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mutable_key_type [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/datakey.rs:108:14 [INFO] [stdout] | [INFO] [stdout] 108 | .map(|annotation| annotation.resources_as_metadata()) [INFO] [stdout] | ______________^ [INFO] [stdout] 109 | | .flatten() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|annotation| annotation.resources_as_metadata())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: mutable key type [INFO] [stdout] --> src/api/datakey.rs:114:32 [INFO] [stdout] | [INFO] [stdout] 114 | pub fn resources(&self) -> BTreeSet> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: ... because it contains `ResultItem<'store, TextResource>`, which has interior mutability [INFO] [stdout] = note: ... because it contains `&TextResource`, which has interior mutability [INFO] [stdout] = note: ... because it contains `TextResource`, which has interior mutability [INFO] [stdout] = note: ... because it contains `Arc>`, which has interior mutability [INFO] [stdout] = note: ... because it contains `RwLock`, which has interior mutability [INFO] [stdout] = note: ... because it contains `RwLock`, which has interior mutability [INFO] [stdout] = note: ... because it contains `Atomic`, which has interior mutability [INFO] [stdout] = note: ... because it contains `UnsafeCell<::Storage>`, which has interior mutability [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mutable_key_type [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/datakey.rs:116:14 [INFO] [stdout] | [INFO] [stdout] 116 | .map(|annotation| annotation.resources()) [INFO] [stdout] | ______________^ [INFO] [stdout] 117 | | .flatten() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|annotation| annotation.resources())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: mutable key type [INFO] [stdout] --> src/api/datakey.rs:122:31 [INFO] [stdout] | [INFO] [stdout] 122 | pub fn datasets(&self) -> BTreeSet> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: ... because it contains `ResultItem<'store, AnnotationDataSet>`, which has interior mutability [INFO] [stdout] = note: ... because it contains `&AnnotationDataSet`, which has interior mutability [INFO] [stdout] = note: ... because it contains `AnnotationDataSet`, which has interior mutability [INFO] [stdout] = note: ... because it contains `Arc>`, which has interior mutability [INFO] [stdout] = note: ... because it contains `RwLock`, which has interior mutability [INFO] [stdout] = note: ... because it contains `RwLock`, which has interior mutability [INFO] [stdout] = note: ... because it contains `Atomic`, which has interior mutability [INFO] [stdout] = note: ... because it contains `UnsafeCell<::Storage>`, which has interior mutability [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mutable_key_type [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/datakey.rs:124:14 [INFO] [stdout] | [INFO] [stdout] 124 | .map(|annotation| annotation.datasets().map(|dataset| dataset.clone())) [INFO] [stdout] | ______________^ [INFO] [stdout] 125 | | .flatten() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|annotation| annotation.datasets().map(|dataset| dataset.clone()))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are needlessly cloning iterator elements [INFO] [stdout] --> src/api/datakey.rs:124:52 [INFO] [stdout] | [INFO] [stdout] 124 | .map(|annotation| annotation.datasets().map(|dataset| dataset.clone())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove the `map` call [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/datakey.rs:183:44 [INFO] [stdout] | [INFO] [stdout] 183 | let mut annotations: Vec<_> = self.map(|key| key.annotations()).flatten().collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|key| key.annotations())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/datakey.rs:199:14 [INFO] [stdout] | [INFO] [stdout] 199 | .map(|key| key.annotations_as_metadata()) [INFO] [stdout] | ______________^ [INFO] [stdout] 200 | | .flatten() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|key| key.annotations_as_metadata())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/api/query.rs:216:1 [INFO] [stdout] | [INFO] [stdout] 216 | / impl Default for QueryQualifier { [INFO] [stdout] 217 | | fn default() -> Self { [INFO] [stdout] 218 | | Self::Normal [INFO] [stdout] 219 | | } [INFO] [stdout] 220 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 198 + #[derive(Default)] [INFO] [stdout] 199 | pub enum QueryQualifier { [INFO] [stdout] 200 | /// Normal behaviour, no changes [INFO] [stdout] 201 ~ #[default] [INFO] [stdout] 202 ~ Normal, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/api/query.rs:241:1 [INFO] [stdout] | [INFO] [stdout] 241 | / impl Default for SelectionQualifier { [INFO] [stdout] 242 | | fn default() -> Self { [INFO] [stdout] 243 | | Self::Normal [INFO] [stdout] 244 | | } [INFO] [stdout] 245 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 224 + #[derive(Default)] [INFO] [stdout] 225 | pub enum SelectionQualifier { [INFO] [stdout] 226 | /// Normal behaviour, no changes. [INFO] [stdout] 227 ~ #[default] [INFO] [stdout] 228 ~ Normal, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/api/query.rs:260:1 [INFO] [stdout] | [INFO] [stdout] 260 | / impl Default for AnnotationDepth { [INFO] [stdout] 261 | | fn default() -> Self { [INFO] [stdout] 262 | | Self::One [INFO] [stdout] 263 | | } [INFO] [stdout] 264 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 249 + #[derive(Default)] [INFO] [stdout] 250 | pub enum AnnotationDepth { [INFO] [stdout] 251 | /// Apply only on the same level [INFO] [stdout] ... [INFO] [stdout] 254 | /// Minimal depth corresponds to a different of exactly one layer in the annotation hierarchy formed by AnnotationSelector (above or below) the current one. [INFO] [stdout] 255 ~ #[default] [INFO] [stdout] 256 ~ One, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `stam::FindRegexIter<'_, '_>` [INFO] [stdout] --> tests/common/mod.rs:295:31 [INFO] [stdout] | [INFO] [stdout] 295 | let annotations: Vec<_> = resource [INFO] [stdout] | _______________________________^ [INFO] [stdout] 296 | | .find_text_regex(&[Regex::new(r"Article \d").unwrap()], None, true)? [INFO] [stdout] 297 | | .into_iter() [INFO] [stdout] | |____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] help: consider removing `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 295 ~ let annotations: Vec<_> = resource [INFO] [stdout] 296 + .find_text_regex(&[Regex::new(r"Article \d").unwrap()], None, true)? [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'b [INFO] [stdout] --> src/api/query.rs:394:21 [INFO] [stdout] | [INFO] [stdout] 394 | fn parse_offset<'b>(mut querystring: &'b str) -> Result<(Option, &'b str), StamError> { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 394 - fn parse_offset<'b>(mut querystring: &'b str) -> Result<(Option, &'b str), StamError> { [INFO] [stdout] 394 + fn parse_offset(mut querystring: &str) -> Result<(Option, &str), StamError> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Result.or_else(|x| Err(y))`, which is more succinctly expressed as `map_err(|x| y)` [INFO] [stdout] --> src/api/query.rs:401:17 [INFO] [stdout] | [INFO] [stdout] 401 | / Cursor::try_from(arg).or_else(|_| { [INFO] [stdout] 402 | | Err(StamError::QuerySyntaxError( [INFO] [stdout] 403 | | format!( [INFO] [stdout] 404 | | "Expected integer for begin cursor after OFFSET, got '{}'", [INFO] [stdout] ... | [INFO] [stdout] 408 | | )) [INFO] [stdout] 409 | | })? [INFO] [stdout] | |__________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] = note: `#[warn(clippy::bind_instead_of_map)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 401 ~ Cursor::try_from(arg).map_err(|_| StamError::QuerySyntaxError( [INFO] [stdout] 402 + format!( [INFO] [stdout] 403 + "Expected integer for begin cursor after OFFSET, got '{}'", [INFO] [stdout] 404 + arg [INFO] [stdout] 405 + ), [INFO] [stdout] 406 + "", [INFO] [stdout] 407 ~ ))? [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Result.or_else(|x| Err(y))`, which is more succinctly expressed as `map_err(|x| y)` [INFO] [stdout] --> src/api/query.rs:417:17 [INFO] [stdout] | [INFO] [stdout] 417 | / Cursor::try_from(arg).or_else(|_| { [INFO] [stdout] 418 | | Err(StamError::QuerySyntaxError( [INFO] [stdout] 419 | | format!( [INFO] [stdout] 420 | | "Expected integer for end cursor, (optional) second parameter after OFFSET, got '{}'", [INFO] [stdout] ... | [INFO] [stdout] 424 | | )) [INFO] [stdout] 425 | | })? [INFO] [stdout] | |__________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 417 ~ Cursor::try_from(arg).map_err(|_| StamError::QuerySyntaxError( [INFO] [stdout] 418 + format!( [INFO] [stdout] 419 + "Expected integer for end cursor, (optional) second parameter after OFFSET, got '{}'", [INFO] [stdout] 420 + arg [INFO] [stdout] 421 + ), [INFO] [stdout] 422 + "", [INFO] [stdout] 423 ~ ))? [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `regex::Error` [INFO] [stdout] --> src/api/query.rs:455:29 [INFO] [stdout] | [INFO] [stdout] 455 | ... err.into(), [INFO] [stdout] | ^^^^^^^^^^ help: consider removing `.into()`: `err` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/api/query.rs:548:40 [INFO] [stdout] | [INFO] [stdout] 548 | Self::DataVariable(&arg[1..], qualifier) [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/api/query.rs:547:17 [INFO] [stdout] | [INFO] [stdout] 547 | if arg.starts_with("?") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] = note: `#[warn(clippy::manual_strip)]` on by default [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 547 ~ if let Some() = arg.strip_prefix("?") { [INFO] [stdout] 548 ~ Self::DataVariable(, qualifier) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/api/query.rs:620:39 [INFO] [stdout] | [INFO] [stdout] 620 | querystring = &remainder[3..]; [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/api/query.rs:619:21 [INFO] [stdout] | [INFO] [stdout] 619 | if remainder.starts_with("OR ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 619 ~ if let Some() = remainder.strip_prefix("OR ") { [INFO] [stdout] 620 ~ querystring = ; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/api/query.rs:623:39 [INFO] [stdout] | [INFO] [stdout] 623 | querystring = &remainder[1..]; [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/api/query.rs:622:28 [INFO] [stdout] | [INFO] [stdout] 622 | } else if remainder.starts_with("]") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 622 ~ } else if let Some() = remainder.strip_prefix("]") { [INFO] [stdout] 623 ~ querystring = ; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/api/query.rs:684:21 [INFO] [stdout] | [INFO] [stdout] 684 | format!("Expected constraint type (DATA, TEXT), got end of string"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Expected constraint type (DATA, TEXT), got end of string".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/query.rs:690:27 [INFO] [stdout] | [INFO] [stdout] 690 | querystring = &querystring[1..].trim_start(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `querystring[1..].trim_start()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/api/query.rs:806:27 [INFO] [stdout] | [INFO] [stdout] 806 | s += &format!("SUBSTORE NONE;"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"SUBSTORE NONE;".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/api/query.rs:843:30 [INFO] [stdout] | [INFO] [stdout] 843 | .map(|s| Cow::Borrowed(s)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Cow::Borrowed` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/api/query.rs:848:38 [INFO] [stdout] | [INFO] [stdout] 848 | ... .map(|s| Cow::Owned(s)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Cow::Owned` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/api/query.rs:916:48 [INFO] [stdout] | [INFO] [stdout] 916 | let id = resource.id().map(|s| Cow::Borrowed(s)).unwrap_or_else(|| { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Cow::Borrowed` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/api/query.rs:920:34 [INFO] [stdout] | [INFO] [stdout] 920 | ... .map(|s| Cow::Owned(s)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Cow::Owned` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/api/query.rs:989:9 [INFO] [stdout] | [INFO] [stdout] 989 | return Some(q); [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 989 - return Some(q); [INFO] [stdout] 989 + Some(q) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this block may be rewritten with the `?` operator [INFO] [stdout] --> src/api/query.rs:979:9 [INFO] [stdout] | [INFO] [stdout] 979 | / if iter.next().is_none() { [INFO] [stdout] 980 | | return None; [INFO] [stdout] 981 | | } [INFO] [stdout] | |_________^ help: replace it with: `iter.next()?;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/api/query.rs:1069:13 [INFO] [stdout] | [INFO] [stdout] 1069 | / if let Some(query) = self.select_by_path(&querypath) { [INFO] [stdout] 1070 | | Some((querypath, query)) [INFO] [stdout] 1071 | | } else { [INFO] [stdout] 1072 | | None [INFO] [stdout] 1073 | | } [INFO] [stdout] | |_____________^ help: try: `self.select_by_path(&querypath).map(|query| (querypath, query))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.iter().nth()` on a `Vec` [INFO] [stdout] --> src/api/query.rs:1106:31 [INFO] [stdout] | [INFO] [stdout] 1106 | if let Some(sq) = q.subqueries.iter().nth(*i) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth [INFO] [stdout] = note: `#[warn(clippy::iter_nth)]` on by default [INFO] [stdout] help: `get` is equivalent but more concise [INFO] [stdout] | [INFO] [stdout] 1106 - if let Some(sq) = q.subqueries.iter().nth(*i) { [INFO] [stdout] 1106 + if let Some(sq) = q.subqueries.get(*i) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/api/query.rs:1197:13 [INFO] [stdout] | [INFO] [stdout] 1197 | / return Err(StamError::QuerySyntaxError( [INFO] [stdout] 1198 | | format!( [INFO] [stdout] 1199 | | "Expected SELECT, ADD or DELETE, got '{}'", [INFO] [stdout] 1200 | | querystring [INFO] [stdout] ... | [INFO] [stdout] 1205 | | "", [INFO] [stdout] 1206 | | )); [INFO] [stdout] | |______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 1197 ~ Err(StamError::QuerySyntaxError( [INFO] [stdout] 1198 + format!( [INFO] [stdout] 1199 + "Expected SELECT, ADD or DELETE, got '{}'", [INFO] [stdout] 1200 + querystring [INFO] [stdout] 1201 + .split(QUERYSPLITCHARS) [INFO] [stdout] 1202 + .next() [INFO] [stdout] 1203 + .unwrap_or("(empty string)"), [INFO] [stdout] 1204 + ), [INFO] [stdout] 1205 + "", [INFO] [stdout] 1206 ~ )) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should use the `starts_with` method [INFO] [stdout] --> src/api/query.rs:1215:15 [INFO] [stdout] | [INFO] [stdout] 1215 | while querystring.chars().next() == Some('@') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `querystring.starts_with('@')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#chars_next_cmp [INFO] [stdout] = note: `#[warn(clippy::chars_next_cmp)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/api/query.rs:1283:21 [INFO] [stdout] | [INFO] [stdout] 1283 | format!("Expected result type (ANNOTATION, DATA, TEXT, KEY, DATASET, RESOURCE), got end of string"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Expected result type (ANNOTATION, DATA, TEXT, KEY, DATASET, RESOURCE), got end of string".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/api/query.rs:1364:21 [INFO] [stdout] | [INFO] [stdout] 1364 | format!("Expected result type ANNOTATION for ADD query got end of string"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Expected result type ANNOTATION for ADD query got end of string".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/api/query.rs:1443:21 [INFO] [stdout] | [INFO] [stdout] 1443 | format!("Expected result type ANNOTATION for DELETE query got end of string"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Expected result type ANNOTATION for DELETE query got end of string".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/query.rs:1497:31 [INFO] [stdout] | [INFO] [stdout] 1497 | querystring = &querystring[1..].trim_start(); //strips the { or | and any spaces [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `querystring[1..].trim_start()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/query.rs:1513:35 [INFO] [stdout] | [INFO] [stdout] 1513 | querystring = &querystring[1..].trim_start(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `querystring[1..].trim_start()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `TextSelection` which implements the `Copy` trait [INFO] [stdout] --> src/api/query.rs:1630:17 [INFO] [stdout] | [INFO] [stdout] 1630 | textselection.inner().clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*textselection.inner()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `TextSelection` which implements the `Copy` trait [INFO] [stdout] --> src/api/query.rs:1643:17 [INFO] [stdout] | [INFO] [stdout] 1643 | textselection.inner().clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*textselection.inner()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/api/query.rs:2024:17 [INFO] [stdout] | [INFO] [stdout] 2024 | format!("AnnotationStore.query() cant not handle mutable queries (ADD/DELETE), expected an immutable one (SELECT)"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"AnnotationStore.query() cant not handle mutable queries (ADD/DELETE), expected an immutable one (SELECT)".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/api/query.rs:2151:37 [INFO] [stdout] | [INFO] [stdout] 2151 | ... format!("ADD query has no TARGET"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"ADD query has no TARGET".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> src/api/query.rs:2155:34 [INFO] [stdout] | [INFO] [stdout] 2155 | ... 1 if complextarget == None => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `complextarget.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] = note: `#[warn(clippy::partialeq_to_none)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary map of the identity function [INFO] [stdout] --> tests/lowlevel.rs:536:47 [INFO] [stdout] | [INFO] [stdout] 536 | .textselections_unsorted() [INFO] [stdout] | _______________________________________________^ [INFO] [stdout] 537 | | .map(|textselection| textselection) [INFO] [stdout] | |_______________________________________________________^ help: remove the call to `map` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_identity [INFO] [stdout] = note: `#[warn(clippy::map_identity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/query.rs:2304:34 [INFO] [stdout] | [INFO] [stdout] 2304 | query.select_by_path(&querypath) [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `querypath` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary map of the identity function [INFO] [stdout] --> tests/lowlevel.rs:573:46 [INFO] [stdout] | [INFO] [stdout] 573 | annotationset.as_ref().keys().map(|key| key).collect(), [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: remove the call to `map` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_identity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/api/query.rs:2320:17 [INFO] [stdout] | [INFO] [stdout] 2320 | while let Some(constraint) = constraintsiter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for constraint in constraintsiter.by_ref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] = note: `#[warn(clippy::while_let_on_iterator)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/api/query.rs:2328:17 [INFO] [stdout] | [INFO] [stdout] 2328 | while let Some(constraint) = constraintsiter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for constraint in constraintsiter.by_ref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/api/query.rs:2336:17 [INFO] [stdout] | [INFO] [stdout] 2336 | while let Some(constraint) = constraintsiter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for constraint in constraintsiter.by_ref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/api/query.rs:2344:17 [INFO] [stdout] | [INFO] [stdout] 2344 | while let Some(constraint) = constraintsiter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for constraint in constraintsiter.by_ref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/api/query.rs:2353:17 [INFO] [stdout] | [INFO] [stdout] 2353 | while let Some(constraint) = constraintsiter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for constraint in constraintsiter.by_ref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/api/query.rs:2362:17 [INFO] [stdout] | [INFO] [stdout] 2362 | while let Some(constraint) = constraintsiter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for constraint in constraintsiter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `state.iterator` after checking its variant with `is_none` [INFO] [stdout] --> src/api/query.rs:2408:27 [INFO] [stdout] | [INFO] [stdout] 2405 | let got_result = if state.iterator.is_none() { [INFO] [stdout] | --------------------------- help: try: `if let Some() = &mut state.iterator` [INFO] [stdout] ... [INFO] [stdout] 2408 | match state.iterator.as_mut().unwrap() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/query.rs:2603:57 [INFO] [stdout] | [INFO] [stdout] 2603 | Box::new(store.annotations().filter_set(&dataset)) [INFO] [stdout] | ^^^^^^^^ help: change this to: `dataset` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/api/query.rs:2620:18 [INFO] [stdout] | [INFO] [stdout] 2620 | Some(&Constraint::Value(ref operator, _)) => Box::new( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] = note: `#[warn(clippy::needless_borrowed_reference)]` on by default [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 2620 - Some(&Constraint::Value(ref operator, _)) => Box::new( [INFO] [stdout] 2620 + Some(Constraint::Value(operator, _)) => Box::new( [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/api/query.rs:2692:18 [INFO] [stdout] | [INFO] [stdout] 2692 | Some(&Constraint::Union(ref subconstraints)) => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 2692 - Some(&Constraint::Union(ref subconstraints)) => { [INFO] [stdout] 2692 + Some(Constraint::Union(subconstraints)) => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/query.rs:2789:42 [INFO] [stdout] | [INFO] [stdout] 2789 | Box::new(iter.filter_key(&key)) [INFO] [stdout] | ^^^^ help: change this to: `key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/query.rs:2793:48 [INFO] [stdout] | [INFO] [stdout] 2793 | Box::new(iter.filter_key_value(&key, operator.clone())) [INFO] [stdout] | ^^^^ help: change this to: `key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/api/query.rs:2870:13 [INFO] [stdout] | [INFO] [stdout] 2870 | &Constraint::Union(ref subconstraints) => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 2870 - &Constraint::Union(ref subconstraints) => { [INFO] [stdout] 2870 + Constraint::Union(subconstraints) => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/api/query.rs:2906:18 [INFO] [stdout] | [INFO] [stdout] 2906 | Some(&Constraint::Data(ref handles, _)) => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 2906 - Some(&Constraint::Data(ref handles, _)) => { [INFO] [stdout] 2906 + Some(Constraint::Data(handles, _)) => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/api/query.rs:2976:18 [INFO] [stdout] | [INFO] [stdout] 2976 | Some(&Constraint::Union(ref subconstraints)) => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 2976 - Some(&Constraint::Union(ref subconstraints)) => { [INFO] [stdout] 2976 + Some(Constraint::Union(subconstraints)) => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/query.rs:3024:42 [INFO] [stdout] | [INFO] [stdout] 3024 | Box::new(iter.filter_key(&key)) [INFO] [stdout] | ^^^^ help: change this to: `key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/query.rs:3028:42 [INFO] [stdout] | [INFO] [stdout] 3028 | Box::new(iter.filter_key(&key).filter_value(operator.clone())) [INFO] [stdout] | ^^^^ help: change this to: `key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/api/query.rs:3034:13 [INFO] [stdout] | [INFO] [stdout] 3034 | &Constraint::Union(ref subconstraints) => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 3034 - &Constraint::Union(ref subconstraints) => { [INFO] [stdout] 3034 + Constraint::Union(subconstraints) => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/api/query.rs:3077:18 [INFO] [stdout] | [INFO] [stdout] 3077 | Some(&Constraint::Keys(ref handles, _)) => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 3077 - Some(&Constraint::Keys(ref handles, _)) => { [INFO] [stdout] 3077 + Some(Constraint::Keys(handles, _)) => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/api/query.rs:3105:18 [INFO] [stdout] | [INFO] [stdout] 3105 | Some(&Constraint::Union(ref subconstraints)) => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 3105 - Some(&Constraint::Union(ref subconstraints)) => { [INFO] [stdout] 3105 + Some(Constraint::Union(subconstraints)) => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/api/query.rs:3136:13 [INFO] [stdout] | [INFO] [stdout] 3136 | &Constraint::Union(ref subconstraints) => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 3136 - &Constraint::Union(ref subconstraints) => { [INFO] [stdout] 3136 + Constraint::Union(subconstraints) => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/api/query.rs:3180:18 [INFO] [stdout] | [INFO] [stdout] 3180 | Some(&Constraint::Union(ref subconstraints)) => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 3180 - Some(&Constraint::Union(ref subconstraints)) => { [INFO] [stdout] 3180 + Some(Constraint::Union(subconstraints)) => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/api/query.rs:3223:13 [INFO] [stdout] | [INFO] [stdout] 3223 | &Constraint::Union(ref subconstraints) => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 3223 - &Constraint::Union(ref subconstraints) => { [INFO] [stdout] 3223 + Constraint::Union(subconstraints) => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/api/query.rs:3263:18 [INFO] [stdout] | [INFO] [stdout] 3263 | Some(&Constraint::TextSelections(ref handles, _)) => Box::new( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 3263 - Some(&Constraint::TextSelections(ref handles, _)) => Box::new( [INFO] [stdout] 3263 + Some(Constraint::TextSelections(handles, _)) => Box::new( [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/api/query.rs:3270:18 [INFO] [stdout] | [INFO] [stdout] 3270 | Some(&Constraint::Annotations(ref handles, _, _)) => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 3270 - Some(&Constraint::Annotations(ref handles, _, _)) => { [INFO] [stdout] 3270 + Some(Constraint::Annotations(handles, _, _)) => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/query.rs:3280:36 [INFO] [stdout] | [INFO] [stdout] 3280 | .textselection(&offset) [INFO] [stdout] | ^^^^^^^ help: change this to: `offset` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/api/query.rs:3376:18 [INFO] [stdout] | [INFO] [stdout] 3376 | Some(&Constraint::Value(ref operator, _)) => Box::new( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 3376 - Some(&Constraint::Value(ref operator, _)) => Box::new( [INFO] [stdout] 3376 + Some(Constraint::Value(operator, _)) => Box::new( [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/query.rs:3428:47 [INFO] [stdout] | [INFO] [stdout] 3428 | Box::new(iter.filter_resource(&resource)) [INFO] [stdout] | ^^^^^^^^^ help: change this to: `resource` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/query.rs:3449:42 [INFO] [stdout] | [INFO] [stdout] 3449 | Box::new(iter.filter_key(&key)) [INFO] [stdout] | ^^^^ help: change this to: `key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/query.rs:3453:48 [INFO] [stdout] | [INFO] [stdout] 3453 | Box::new(iter.filter_key_value(&key, operator.clone())) [INFO] [stdout] | ^^^^ help: change this to: `key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/query.rs:3457:53 [INFO] [stdout] | [INFO] [stdout] 3457 | Box::new(iter.filter_annotationdata(&data)) [INFO] [stdout] | ^^^^^ help: change this to: `data` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/api/query.rs:3459:13 [INFO] [stdout] | [INFO] [stdout] 3459 | &Constraint::Value(ref operator, _) => Box::new(iter.filter_value(operator.clone())), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 3459 - &Constraint::Value(ref operator, _) => Box::new(iter.filter_value(operator.clone())), [INFO] [stdout] 3459 + Constraint::Value(operator, _) => Box::new(iter.filter_value(operator.clone())), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for cloning elements [INFO] [stdout] --> src/api/query.rs:3472:49 [INFO] [stdout] | [INFO] [stdout] 3472 | ... .filter_map(|x| x.as_resultitem().map(|x| x.clone())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `cloned` method: `x.as_resultitem().cloned()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for cloning elements [INFO] [stdout] --> src/api/query.rs:3482:49 [INFO] [stdout] | [INFO] [stdout] 3482 | ... .filter_map(|x| x.as_resultitem().map(|x| x.clone())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `cloned` method: `x.as_resultitem().cloned()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/api/query.rs:3517:18 [INFO] [stdout] | [INFO] [stdout] 3517 | Some(&Constraint::Resources(ref handles, _)) => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 3517 - Some(&Constraint::Resources(ref handles, _)) => { [INFO] [stdout] 3517 + Some(Constraint::Resources(handles, _)) => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/api/query.rs:3628:18 [INFO] [stdout] | [INFO] [stdout] 3628 | Some(&Constraint::Union(ref subconstraints)) => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 3628 - Some(&Constraint::Union(ref subconstraints)) => { [INFO] [stdout] 3628 + Some(Constraint::Union(subconstraints)) => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/query.rs:3679:54 [INFO] [stdout] | [INFO] [stdout] 3679 | Box::new(iter.filter_key_in_metadata(&key)) [INFO] [stdout] | ^^^^ help: change this to: `key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/query.rs:3683:50 [INFO] [stdout] | [INFO] [stdout] 3683 | Box::new(iter.filter_key_on_text(&key)) [INFO] [stdout] | ^^^^ help: change this to: `key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/query.rs:3687:65 [INFO] [stdout] | [INFO] [stdout] 3687 | Box::new(iter.filter_annotationdata_in_metadata(&data)) [INFO] [stdout] | ^^^^^ help: change this to: `data` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/query.rs:3691:61 [INFO] [stdout] | [INFO] [stdout] 3691 | Box::new(iter.filter_annotationdata_on_text(&data)) [INFO] [stdout] | ^^^^^ help: change this to: `data` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/query.rs:3704:56 [INFO] [stdout] | [INFO] [stdout] 3704 | Box::new(iter.filter_key_value_on_text(&key, operator.clone())) [INFO] [stdout] | ^^^^ help: change this to: `key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/query.rs:3708:60 [INFO] [stdout] | [INFO] [stdout] 3708 | Box::new(iter.filter_key_value_in_metadata(&key, operator.clone())) [INFO] [stdout] | ^^^^ help: change this to: `key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/api/query.rs:3710:13 [INFO] [stdout] | [INFO] [stdout] 3710 | &Constraint::Union(ref subconstraints) => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 3710 - &Constraint::Union(ref subconstraints) => { [INFO] [stdout] 3710 + Constraint::Union(subconstraints) => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/api/query.rs:3795:9 [INFO] [stdout] | [INFO] [stdout] 3795 | / return Err(StamError::VariableNotFoundError( [INFO] [stdout] 3796 | | name.into(), [INFO] [stdout] 3797 | | Some(Type::AnnotationData), [INFO] [stdout] 3798 | | "resolve_datavar", [INFO] [stdout] 3799 | | )); [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 3795 ~ Err(StamError::VariableNotFoundError( [INFO] [stdout] 3796 + name.into(), [INFO] [stdout] 3797 + Some(Type::AnnotationData), [INFO] [stdout] 3798 + "resolve_datavar", [INFO] [stdout] 3799 ~ )) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/api/query.rs:3826:9 [INFO] [stdout] | [INFO] [stdout] 3826 | / return Err(StamError::VariableNotFoundError( [INFO] [stdout] 3827 | | name.into(), [INFO] [stdout] 3828 | | Some(Type::DataKey), [INFO] [stdout] 3829 | | "resolve_keyvar", [INFO] [stdout] 3830 | | )); [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 3826 ~ Err(StamError::VariableNotFoundError( [INFO] [stdout] 3827 + name.into(), [INFO] [stdout] 3828 + Some(Type::DataKey), [INFO] [stdout] 3829 + "resolve_keyvar", [INFO] [stdout] 3830 ~ )) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/api/query.rs:3860:9 [INFO] [stdout] | [INFO] [stdout] 3860 | / return Err(StamError::VariableNotFoundError( [INFO] [stdout] 3861 | | name.into(), [INFO] [stdout] 3862 | | Some(Type::AnnotationDataSet), [INFO] [stdout] 3863 | | "resolve_datasetvar", [INFO] [stdout] 3864 | | )); [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 3860 ~ Err(StamError::VariableNotFoundError( [INFO] [stdout] 3861 + name.into(), [INFO] [stdout] 3862 + Some(Type::AnnotationDataSet), [INFO] [stdout] 3863 + "resolve_datasetvar", [INFO] [stdout] 3864 ~ )) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/api/query.rs:3894:9 [INFO] [stdout] | [INFO] [stdout] 3894 | / return Err(StamError::VariableNotFoundError( [INFO] [stdout] 3895 | | name.into(), [INFO] [stdout] 3896 | | Some(Type::Annotation), [INFO] [stdout] 3897 | | "resolve_annotationvar", [INFO] [stdout] 3898 | | )); [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 3894 ~ Err(StamError::VariableNotFoundError( [INFO] [stdout] 3895 + name.into(), [INFO] [stdout] 3896 + Some(Type::Annotation), [INFO] [stdout] 3897 + "resolve_annotationvar", [INFO] [stdout] 3898 ~ )) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/api/query.rs:3925:9 [INFO] [stdout] | [INFO] [stdout] 3925 | / return Err(StamError::VariableNotFoundError( [INFO] [stdout] 3926 | | name.into(), [INFO] [stdout] 3927 | | Some(Type::TextSelection), [INFO] [stdout] 3928 | | "resolve_textvar", [INFO] [stdout] 3929 | | )); [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 3925 ~ Err(StamError::VariableNotFoundError( [INFO] [stdout] 3926 + name.into(), [INFO] [stdout] 3927 + Some(Type::TextSelection), [INFO] [stdout] 3928 + "resolve_textvar", [INFO] [stdout] 3929 ~ )) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/api/query.rs:3959:9 [INFO] [stdout] | [INFO] [stdout] 3959 | / return Err(StamError::VariableNotFoundError( [INFO] [stdout] 3960 | | name.into(), [INFO] [stdout] 3961 | | Some(Type::TextResource), [INFO] [stdout] 3962 | | "resolve_resourcevar", [INFO] [stdout] 3963 | | )); [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 3959 ~ Err(StamError::VariableNotFoundError( [INFO] [stdout] 3960 + name.into(), [INFO] [stdout] 3961 + Some(Type::TextResource), [INFO] [stdout] 3962 + "resolve_resourcevar", [INFO] [stdout] 3963 ~ )) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/api/query.rs:3993:9 [INFO] [stdout] | [INFO] [stdout] 3993 | / return Err(StamError::VariableNotFoundError( [INFO] [stdout] 3994 | | name.into(), [INFO] [stdout] 3995 | | Some(Type::AnnotationSubStore), [INFO] [stdout] 3996 | | "Variable of type SUBSTORE not found", [INFO] [stdout] 3997 | | )); [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 3993 ~ Err(StamError::VariableNotFoundError( [INFO] [stdout] 3994 + name.into(), [INFO] [stdout] 3995 + Some(Type::AnnotationSubStore), [INFO] [stdout] 3996 + "Variable of type SUBSTORE not found", [INFO] [stdout] 3997 ~ )) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'q [INFO] [stdout] --> src/api/query.rs:4090:13 [INFO] [stdout] | [INFO] [stdout] 4090 | fn next<'q>(&'q mut self) -> Option { [INFO] [stdout] | ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 4090 - fn next<'q>(&'q mut self) -> Option { [INFO] [stdout] 4090 + fn next(&mut self) -> Option { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/api/query.rs:4132:9 [INFO] [stdout] | [INFO] [stdout] 4132 | return Some(result); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 4132 - return Some(result); [INFO] [stdout] 4132 + Some(result) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `QueryResultItems` has a public `len` method, but no `is_empty` method [INFO] [stdout] --> src/api/query.rs:4142:5 [INFO] [stdout] | [INFO] [stdout] 4142 | pub fn len(&self) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_without_is_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/api/query.rs:4247:9 [INFO] [stdout] | [INFO] [stdout] 4247 | / if !c.is_ascii_digit() { [INFO] [stdout] 4248 | | if c != '-' || prevc != None { [INFO] [stdout] 4249 | | numeric = false; [INFO] [stdout] 4250 | | } [INFO] [stdout] 4251 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 4247 ~ if !c.is_ascii_digit() [INFO] [stdout] 4248 ~ && (c != '-' || prevc != None) { [INFO] [stdout] 4249 | numeric = false; [INFO] [stdout] 4250 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> src/api/query.rs:4248:28 [INFO] [stdout] | [INFO] [stdout] 4248 | if c != '-' || prevc != None { [INFO] [stdout] | ^^^^^^^^^^^^^ help: use `Option::is_some()` instead: `prevc.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/query.rs:4272:49 [INFO] [stdout] | [INFO] [stdout] 4272 | if DateTime::parse_from_rfc3339(&s).is_ok() { [INFO] [stdout] | ^^ help: change this to: `s` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/api/query.rs:4283:12 [INFO] [stdout] | [INFO] [stdout] 4283 | fn get_arg<'a>(querystring: &'a str) -> Result<(&'a str, &'a str, ArgType), StamError> { [INFO] [stdout] | ^^ ^^ ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 4283 - fn get_arg<'a>(querystring: &'a str) -> Result<(&'a str, &'a str, ArgType), StamError> { [INFO] [stdout] 4283 + fn get_arg(querystring: &str) -> Result<(&str, &str, ArgType), StamError> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/api/query.rs:4314:5 [INFO] [stdout] | [INFO] [stdout] 4314 | / return Err(StamError::QuerySyntaxError( [INFO] [stdout] 4315 | | format!( [INFO] [stdout] 4316 | | "Failed to parse argument '{}'. Missing semicolon perhaps?", [INFO] [stdout] 4317 | | querystring [INFO] [stdout] 4318 | | ), [INFO] [stdout] 4319 | | "", [INFO] [stdout] 4320 | | )); [INFO] [stdout] | |______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 4314 ~ Err(StamError::QuerySyntaxError( [INFO] [stdout] 4315 + format!( [INFO] [stdout] 4316 + "Failed to parse argument '{}'. Missing semicolon perhaps?", [INFO] [stdout] 4317 + querystring [INFO] [stdout] 4318 + ), [INFO] [stdout] 4319 + "", [INFO] [stdout] 4320 ~ )) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/query.rs:4294:31 [INFO] [stdout] | [INFO] [stdout] 4294 | return Ok((s, &querystring[i + 1..].trim_start(), get_arg_type(s, true))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `querystring[i + 1..].trim_start()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/query.rs:4301:17 [INFO] [stdout] | [INFO] [stdout] 4301 | &querystring[i + 1..].trim_start(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `querystring[i + 1..].trim_start()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/query.rs:4308:17 [INFO] [stdout] | [INFO] [stdout] 4308 | &querystring[i..].trim_start(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `querystring[i..].trim_start()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Result.or_else(|x| Err(y))`, which is more succinctly expressed as `map_err(|x| y)` [INFO] [stdout] --> src/api/query.rs:4589:45 [INFO] [stdout] | [INFO] [stdout] 4589 | ArgType::Integer => DataValue::try_from(value).or_else(|_| { [INFO] [stdout] | _____________________________________________^ [INFO] [stdout] 4590 | | Err(StamError::QuerySyntaxError( [INFO] [stdout] 4591 | | format!("Expected integer in assignment, got '{}'", value), [INFO] [stdout] 4592 | | "", [INFO] [stdout] 4593 | | )) [INFO] [stdout] 4594 | | })?, [INFO] [stdout] | |__________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 4589 ~ ArgType::Integer => DataValue::try_from(value).map_err(|_| StamError::QuerySyntaxError( [INFO] [stdout] 4590 + format!("Expected integer in assignment, got '{}'", value), [INFO] [stdout] 4591 + "", [INFO] [stdout] 4592 ~ ))?, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of a fallible conversion when an infallible one could be used [INFO] [stdout] --> src/api/query.rs:4589:45 [INFO] [stdout] | [INFO] [stdout] 4589 | ArgType::Integer => DataValue::try_from(value).or_else(|_| { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: converting `&str` to `DataValue` cannot fail [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fallible_conversions [INFO] [stdout] = note: `#[warn(clippy::unnecessary_fallible_conversions)]` on by default [INFO] [stdout] help: use [INFO] [stdout] | [INFO] [stdout] 4589 - ArgType::Integer => DataValue::try_from(value).or_else(|_| { [INFO] [stdout] 4589 + ArgType::Integer => From::from(value).or_else(|_| { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Result.or_else(|x| Err(y))`, which is more succinctly expressed as `map_err(|x| y)` [INFO] [stdout] --> src/api/query.rs:4595:43 [INFO] [stdout] | [INFO] [stdout] 4595 | ArgType::Float => DataValue::try_from(value).or_else(|_| { [INFO] [stdout] | ___________________________________________^ [INFO] [stdout] 4596 | | Err(StamError::QuerySyntaxError( [INFO] [stdout] 4597 | | format!("Expected integer in assignment, got '{}'", value), [INFO] [stdout] 4598 | | "", [INFO] [stdout] 4599 | | )) [INFO] [stdout] 4600 | | })?, [INFO] [stdout] | |__________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 4595 ~ ArgType::Float => DataValue::try_from(value).map_err(|_| StamError::QuerySyntaxError( [INFO] [stdout] 4596 + format!("Expected integer in assignment, got '{}'", value), [INFO] [stdout] 4597 + "", [INFO] [stdout] 4598 ~ ))?, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of a fallible conversion when an infallible one could be used [INFO] [stdout] --> src/api/query.rs:4595:43 [INFO] [stdout] | [INFO] [stdout] 4595 | ArgType::Float => DataValue::try_from(value).or_else(|_| { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: converting `&str` to `DataValue` cannot fail [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fallible_conversions [INFO] [stdout] help: use [INFO] [stdout] | [INFO] [stdout] 4595 - ArgType::Float => DataValue::try_from(value).or_else(|_| { [INFO] [stdout] 4595 + ArgType::Float => From::from(value).or_else(|_| { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/api/query.rs:4615:25 [INFO] [stdout] | [INFO] [stdout] 4615 | format!("Expected name for TARGET"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Expected name for TARGET".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/api/query.rs:4640:21 [INFO] [stdout] | [INFO] [stdout] 4640 | format!("Expected assignment type (DATA, ID, TARGET), got end of string"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Expected assignment type (DATA, ID, TARGET), got end of string".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/query.rs:4646:27 [INFO] [stdout] | [INFO] [stdout] 4646 | querystring = &querystring[1..].trim_start(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `querystring[1..].trim_start()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'b [INFO] [stdout] --> src/api/query.rs:4676:21 [INFO] [stdout] | [INFO] [stdout] 4676 | fn parse_offset<'b>(mut querystring: &'b str) -> Result<(Option, &'b str), StamError> { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 4676 - fn parse_offset<'b>(mut querystring: &'b str) -> Result<(Option, &'b str), StamError> { [INFO] [stdout] 4676 + fn parse_offset(mut querystring: &str) -> Result<(Option, &str), StamError> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Result.or_else(|x| Err(y))`, which is more succinctly expressed as `map_err(|x| y)` [INFO] [stdout] --> src/api/query.rs:4683:17 [INFO] [stdout] | [INFO] [stdout] 4683 | / Cursor::try_from(arg).or_else(|_| { [INFO] [stdout] 4684 | | Err(StamError::QuerySyntaxError( [INFO] [stdout] 4685 | | format!( [INFO] [stdout] 4686 | | "Expected integer for begin cursor after OFFSET, got '{}'", [INFO] [stdout] ... | [INFO] [stdout] 4690 | | )) [INFO] [stdout] 4691 | | })? [INFO] [stdout] | |__________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 4683 ~ Cursor::try_from(arg).map_err(|_| StamError::QuerySyntaxError( [INFO] [stdout] 4684 + format!( [INFO] [stdout] 4685 + "Expected integer for begin cursor after OFFSET, got '{}'", [INFO] [stdout] 4686 + arg [INFO] [stdout] 4687 + ), [INFO] [stdout] 4688 + "", [INFO] [stdout] 4689 ~ ))? [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Result.or_else(|x| Err(y))`, which is more succinctly expressed as `map_err(|x| y)` [INFO] [stdout] --> src/api/query.rs:4699:17 [INFO] [stdout] | [INFO] [stdout] 4699 | / Cursor::try_from(arg).or_else(|_| { [INFO] [stdout] 4700 | | Err(StamError::QuerySyntaxError( [INFO] [stdout] 4701 | | format!( [INFO] [stdout] 4702 | | "Expected integer for end cursor, (optional) second parameter after OFFSET, got '{}'", [INFO] [stdout] ... | [INFO] [stdout] 4706 | | )) [INFO] [stdout] 4707 | | })? [INFO] [stdout] | |__________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 4699 ~ Cursor::try_from(arg).map_err(|_| StamError::QuerySyntaxError( [INFO] [stdout] 4700 + format!( [INFO] [stdout] 4701 + "Expected integer for end cursor, (optional) second parameter after OFFSET, got '{}'", [INFO] [stdout] 4702 + arg [INFO] [stdout] 4703 + ), [INFO] [stdout] 4704 + "", [INFO] [stdout] 4705 ~ ))? [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/resources.rs:240:14 [INFO] [stdout] | [INFO] [stdout] 240 | .map(|resource| resource.annotations_as_metadata()) [INFO] [stdout] | ______________^ [INFO] [stdout] 241 | | .flatten() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|resource| resource.annotations_as_metadata())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/resources.rs:257:14 [INFO] [stdout] | [INFO] [stdout] 257 | .map(|resource| resource.annotations()) [INFO] [stdout] | ______________^ [INFO] [stdout] 258 | | .flatten() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|resource| resource.annotations())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/resources.rs:270:14 [INFO] [stdout] | [INFO] [stdout] 270 | .map(|resource| resource.textselections()) [INFO] [stdout] | ______________^ [INFO] [stdout] 271 | | .flatten() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|resource| resource.textselections())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/text.rs:517:43 [INFO] [stdout] | [INFO] [stdout] 517 | let offset = self.absolute_offset(&offset)?; //turns the relative offset into an absolute one (i.e. offsets in TextResource) [INFO] [stdout] | ^^^^^^^ help: change this to: `offset` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/text.rs:708:43 [INFO] [stdout] | [INFO] [stdout] 708 | let offset = self.absolute_offset(&offset)?; //turns the relative offset into an absolute one (i.e. offsets in TextResource) [INFO] [stdout] | ^^^^^^^ help: change this to: `offset` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a, 'b [INFO] [stdout] --> src/api/text.rs:768:50 [INFO] [stdout] | [INFO] [stdout] 768 | pub(crate) fn find_text_regex_select_expressions<'a, 'b>( [INFO] [stdout] | ^^ ^^ [INFO] [stdout] 769 | text: &'a str, [INFO] [stdout] | ^^ [INFO] [stdout] 770 | expressions: &'b [Regex], [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 768 ~ pub(crate) fn find_text_regex_select_expressions( [INFO] [stdout] 769 ~ text: &str, [INFO] [stdout] 770 ~ expressions: &[Regex], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Some` variant of the iterator element is used [INFO] [stdout] --> src/api/text.rs:816:17 [INFO] [stdout] | [INFO] [stdout] 816 | / for group in m.iter() { [INFO] [stdout] 817 | | if let Some(group) = group { [INFO] [stdout] 818 | | if begin.is_none() || begin.unwrap() < group.start() { [INFO] [stdout] 819 | | begin = Some(group.start()); [INFO] [stdout] ... | [INFO] [stdout] 822 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/api/text.rs:817:21 [INFO] [stdout] | [INFO] [stdout] 817 | / if let Some(group) = group { [INFO] [stdout] 818 | | if begin.is_none() || begin.unwrap() < group.start() { [INFO] [stdout] 819 | | begin = Some(group.start()); [INFO] [stdout] 820 | | } [INFO] [stdout] 821 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 816 ~ for group in m.iter().flatten() { [INFO] [stdout] 817 + if begin.is_none() || begin.unwrap() < group.start() { [INFO] [stdout] 818 + begin = Some(group.start()); [INFO] [stdout] 819 + } [INFO] [stdout] 820 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Some` variant of the iterator element is used [INFO] [stdout] --> src/api/text.rs:834:17 [INFO] [stdout] | [INFO] [stdout] 834 | / for group in m.iter() { [INFO] [stdout] 835 | | if let Some(group) = group { [INFO] [stdout] 836 | | if end.is_none() || end.unwrap() < group.start() { [INFO] [stdout] 837 | | end = Some(group.start()); [INFO] [stdout] ... | [INFO] [stdout] 840 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/api/text.rs:835:21 [INFO] [stdout] | [INFO] [stdout] 835 | / if let Some(group) = group { [INFO] [stdout] 836 | | if end.is_none() || end.unwrap() < group.start() { [INFO] [stdout] 837 | | end = Some(group.start()); [INFO] [stdout] 838 | | } [INFO] [stdout] 839 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 834 ~ for group in m.iter().flatten() { [INFO] [stdout] 835 + if end.is_none() || end.unwrap() < group.start() { [INFO] [stdout] 836 + end = Some(group.start()); [INFO] [stdout] 837 + } [INFO] [stdout] 838 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/api/text.rs:853:17 [INFO] [stdout] | [INFO] [stdout] 853 | / if let Some(m) = iter.next() { [INFO] [stdout] 854 | | Some(Match::NoCapture(m)) [INFO] [stdout] 855 | | } else { [INFO] [stdout] 856 | | None [INFO] [stdout] 857 | | } [INFO] [stdout] | |_________________^ help: try: `iter.next().map(Match::NoCapture)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/api/text.rs:860:17 [INFO] [stdout] | [INFO] [stdout] 860 | / if let Some(m) = iter.next() { [INFO] [stdout] 861 | | Some(Match::WithCapture(m)) [INFO] [stdout] 862 | | } else { [INFO] [stdout] 863 | | None [INFO] [stdout] 864 | | } [INFO] [stdout] | |_________________^ help: try: `iter.next().map(Match::WithCapture)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/api/text.rs:988:21 [INFO] [stdout] | [INFO] [stdout] 988 | / if j != i && m2.is_some() { [INFO] [stdout] 989 | | if m2.as_ref().unwrap().begin() >= m.begin() [INFO] [stdout] 990 | | && m2.as_ref().unwrap().begin() < m.end() [INFO] [stdout] ... | [INFO] [stdout] 995 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 988 ~ if j != i && m2.is_some() [INFO] [stdout] 989 ~ && m2.as_ref().unwrap().begin() >= m.begin() [INFO] [stdout] 990 | && m2.as_ref().unwrap().begin() < m.end() [INFO] [stdout] ... [INFO] [stdout] 993 | *m2 = self.matchiters[j].next(); [INFO] [stdout] 994 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/api/text.rs:1102:17 [INFO] [stdout] | [INFO] [stdout] 1102 | if let Some(text) = resource.text_by_offset(&self.offset).ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] help: consider matching on `Ok(text)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 1102 - if let Some(text) = resource.text_by_offset(&self.offset).ok() { [INFO] [stdout] 1102 + if let Ok(text) = resource.text_by_offset(&self.offset) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/api/text.rs:1161:17 [INFO] [stdout] | [INFO] [stdout] 1161 | if let Some(text) = resource.text_by_offset(&self.offset).ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] help: consider matching on `Ok(text)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 1161 - if let Some(text) = resource.text_by_offset(&self.offset).ok() { [INFO] [stdout] 1161 + if let Ok(text) = resource.text_by_offset(&self.offset) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/textselection.rs:178:46 [INFO] [stdout] | [INFO] [stdout] 178 | Self::Unbound(_, _, item) => &item, [INFO] [stdout] | ^^^^^ help: change this to: `item` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/textselection.rs:192:42 [INFO] [stdout] | [INFO] [stdout] 192 | Self::Unbound(_, _, item) => &item, [INFO] [stdout] | ^^^^^ help: change this to: `item` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/textselection.rs:211:42 [INFO] [stdout] | [INFO] [stdout] 211 | Self::Unbound(_, _, item) => &item, [INFO] [stdout] | ^^^^^ help: change this to: `item` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `textselection::TextSelection` [INFO] [stdout] --> src/api/textselection.rs:296:34 [INFO] [stdout] | [INFO] [stdout] 296 | Self::Bound(item) => item.as_ref().clone().into(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `item.as_ref().clone()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `TextSelection` which implements the `Copy` trait [INFO] [stdout] --> src/api/textselection.rs:296:34 [INFO] [stdout] | [INFO] [stdout] 296 | Self::Bound(item) => item.as_ref().clone().into(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `(*item.as_ref())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `TextSelection` which implements the `Copy` trait [INFO] [stdout] --> src/api/textselection.rs:297:51 [INFO] [stdout] | [INFO] [stdout] 297 | Self::Unbound(_, _, textselection) => textselection.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*textselection` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the impl [INFO] [stdout] --> src/api/textselection.rs:527:6 [INFO] [stdout] | [INFO] [stdout] 527 | impl<'store, I> SortTextualOrder for I [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the impl [INFO] [stdout] --> src/api/textselection.rs:549:6 [INFO] [stdout] | [INFO] [stdout] 549 | impl<'store, I> SortTextualOrder for I [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_unstable` [INFO] [stdout] --> src/api/textselection.rs:555:9 [INFO] [stdout] | [INFO] [stdout] 555 | v.sort_unstable_by(|a, b| a.cmp(b)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] = note: `#[warn(clippy::unnecessary_sort_by)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 555 - v.sort_unstable_by(|a, b| a.cmp(b)); [INFO] [stdout] 555 + v.sort_unstable(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/api/textselection.rs:624:18 [INFO] [stdout] | [INFO] [stdout] 624 | .map(|textselection| ResultTextSelection::Bound(textselection)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `ResultTextSelection::Bound` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/api/textselection.rs:636:18 [INFO] [stdout] | [INFO] [stdout] 636 | .map(|textselection| ResultTextSelection::Bound(textselection)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `ResultTextSelection::Bound` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/api/textselection.rs:661:14 [INFO] [stdout] | [INFO] [stdout] 661 | .map(|resource| resource.annotations()) [INFO] [stdout] | ______________^ [INFO] [stdout] 662 | | .flatten() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|resource| resource.annotations())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/api/textselection.rs:708:13 [INFO] [stdout] | [INFO] [stdout] 708 | return text; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 708 - return text; [INFO] [stdout] 708 + text [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_none()` [INFO] [stdout] --> src/api/textselection.rs:707:16 [INFO] [stdout] | [INFO] [stdout] 707 | if let None = iter.next() { [INFO] [stdout] | -------^^^^-------------- help: try: `if iter.next().is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/api/textselection.rs:1004:17 [INFO] [stdout] | [INFO] [stdout] 1004 | / if let Some(handle) = item.handle() { [INFO] [stdout] 1005 | | Some((item.resource().handle(), handle)) [INFO] [stdout] 1006 | | } else { [INFO] [stdout] 1007 | | None [INFO] [stdout] 1008 | | } [INFO] [stdout] | |_________________^ help: try: `item.handle().map(|handle| (item.resource().handle(), handle))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `foundresource` after checking its variant with `is_some` [INFO] [stdout] --> src/api/textselection.rs:1190:24 [INFO] [stdout] | [INFO] [stdout] 1189 | if foundresource.is_some() { [INFO] [stdout] | -------------------------- help: try: `if let Some() = foundresource` [INFO] [stdout] 1190 | if foundresource.unwrap() == tsel.resource().handle() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/api/webanno.rs:63:9 [INFO] [stdout] | [INFO] [stdout] 63 | / match scheme { [INFO] [stdout] 64 | | "http" | "https" | "urn" | "file" | "_" => true, [INFO] [stdout] 65 | | _ => false, [INFO] [stdout] 66 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] = note: `#[warn(clippy::match_like_matches_macro)]` on by default [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 63 - match scheme { [INFO] [stdout] 64 - "http" | "https" | "urn" | "file" | "_" => true, [INFO] [stdout] 65 - _ => false, [INFO] [stdout] 66 - } [INFO] [stdout] 63 + matches!(scheme, "http" | "https" | "urn" | "file" | "_") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/api/webanno.rs:202:17 [INFO] [stdout] | [INFO] [stdout] 202 | / if (dataset_id.ends_with(".jsonld") || dataset_id.ends_with(".json")) [INFO] [stdout] 203 | | && is_iri(dataset_id) [INFO] [stdout] 204 | | { [INFO] [stdout] 205 | | if self.extra_context.iter().all(|x| x != dataset_id) { [INFO] [stdout] ... | [INFO] [stdout] 208 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 203 ~ && is_iri(dataset_id) [INFO] [stdout] 204 ~ && self.extra_context.iter().all(|x| x != dataset_id) { [INFO] [stdout] 205 | self.extra_context.push(dataset_id.to_string()); [INFO] [stdout] 206 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/api/webanno.rs:642:29 [INFO] [stdout] | [INFO] [stdout] 642 | ann_out += &format!( [INFO] [stdout] | _____________________________^ [INFO] [stdout] 643 | | "{}", [INFO] [stdout] 644 | | &output_selector(selector, store, config, true, need_second_pass, second_pass) [INFO] [stdout] 645 | | ); [INFO] [stdout] | |_________________^ help: consider using `.to_string()`: `(&output_selector(selector, store, config, true, need_second_pass, second_pass)).to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/api/webanno.rs:655:29 [INFO] [stdout] | [INFO] [stdout] 655 | ann_out += &format!( [INFO] [stdout] | _____________________________^ [INFO] [stdout] 656 | | "{}", [INFO] [stdout] 657 | | &output_selector(selector, store, config, true, need_second_pass, second_pass) [INFO] [stdout] 658 | | ); [INFO] [stdout] | |_________________^ help: consider using `.to_string()`: `(&output_selector(selector, store, config, true, need_second_pass, second_pass)).to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/api/webanno.rs:668:29 [INFO] [stdout] | [INFO] [stdout] 668 | ann_out += &format!( [INFO] [stdout] | _____________________________^ [INFO] [stdout] 669 | | "{}", [INFO] [stdout] 670 | | &output_selector(selector, store, config, true, need_second_pass, second_pass) [INFO] [stdout] 671 | | ); [INFO] [stdout] | |_________________^ help: consider using `.to_string()`: `(&output_selector(selector, store, config, true, need_second_pass, second_pass)).to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/api/webanno.rs:689:33 [INFO] [stdout] | [INFO] [stdout] 689 | ann_out += &format!( [INFO] [stdout] | _________________________________^ [INFO] [stdout] 690 | | "{}", [INFO] [stdout] 691 | | &output_selector( [INFO] [stdout] 692 | | &subselector, [INFO] [stdout] ... | [INFO] [stdout] 699 | | ); [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] help: consider using `.to_string()` [INFO] [stdout] | [INFO] [stdout] 689 ~ ann_out += &(&output_selector( [INFO] [stdout] 690 + &subselector, [INFO] [stdout] 691 + store, [INFO] [stdout] 692 + config, [INFO] [stdout] 693 + true, [INFO] [stdout] 694 + need_second_pass, [INFO] [stdout] 695 + second_pass [INFO] [stdout] 696 ~ )).to_string(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/webanno.rs:692:29 [INFO] [stdout] | [INFO] [stdout] 692 | ... &subselector, [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `subselector` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/api/transpose.rs:60:1 [INFO] [stdout] | [INFO] [stdout] 60 | / impl Default for TranspositionSide { [INFO] [stdout] 61 | | fn default() -> Self { [INFO] [stdout] 62 | | TranspositionSide::Auto [INFO] [stdout] 63 | | } [INFO] [stdout] 64 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 53 + #[derive(Default)] [INFO] [stdout] 54 | pub enum TranspositionSide { [INFO] [stdout] 55 | /// Automatically determine the transposition side [INFO] [stdout] 56 ~ #[default] [INFO] [stdout] 57 ~ Auto, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/api/transpose.rs:525:32 [INFO] [stdout] | [INFO] [stdout] 525 | ... if !self.rootstore().annotation(source_id.as_str()).is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.rootstore().annotation(source_id.as_str()).is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/api/transpose.rs:154:13 [INFO] [stdout] | [INFO] [stdout] 154 | self.inner().iter().map(|x| x.clone()).collect(); //MAYBE TODO: slightly waste of time/space if the transposition turns... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `self.inner().iter().copied()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `TextSelection` which implements the `Copy` trait [INFO] [stdout] --> src/api/transpose.rs:154:41 [INFO] [stdout] | [INFO] [stdout] 154 | ... self.inner().iter().map(|x| x.clone()).collect(); //MAYBE TODO: slightly waste of time/space if the transposition turns out t... [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*x` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/api/transpose.rs:161:20 [INFO] [stdout] | [INFO] [stdout] 161 | let sides: SmallVec< [INFO] [stdout] | ____________________^ [INFO] [stdout] 162 | | [( [INFO] [stdout] 163 | | SmallVec<[ResultTextSelection<'store>; 1]>, //textselections [INFO] [stdout] 164 | | ResultItem<'store, Annotation>, //annotation [INFO] [stdout] 165 | | ); 2], [INFO] [stdout] 166 | | > = via [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `TextSelection` which implements the `Copy` trait [INFO] [stdout] --> src/api/transpose.rs:185:98 [INFO] [stdout] | [INFO] [stdout] 185 | let tsel = ResultTextSelection::Unbound(self.rootstore(), resource.as_ref() ,tsel.clone()); [INFO] [stdout] | ^^^^^^^^^^^^ help: try removing the `clone` call: `tsel` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `TextSelection` which implements the `Copy` trait [INFO] [stdout] --> src/api/transpose.rs:222:113 [INFO] [stdout] | [INFO] [stdout] 222 | ... let tmp = ResultTextSelection::Unbound(self.rootstore(), resource.as_ref() ,tsel.clone()); [INFO] [stdout] | ^^^^^^^^^^^^ help: try removing the `clone` call: `tsel` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `TextSelection` which implements the `Copy` trait [INFO] [stdout] --> src/api/transpose.rs:223:120 [INFO] [stdout] | [INFO] [stdout] 223 | ... let remainder = ResultTextSelection::Unbound(self.rootstore(), resource.as_ref() ,remainder.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `remainder` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `TextSelection` which implements the `Copy` trait [INFO] [stdout] --> src/api/transpose.rs:231:130 [INFO] [stdout] | [INFO] [stdout] 231 | ...store(), resource.as_ref() ,intersection.clone())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `intersection` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `TextSelection` which implements the `Copy` trait [INFO] [stdout] --> src/api/transpose.rs:237:113 [INFO] [stdout] | [INFO] [stdout] 237 | ... let tmp = ResultTextSelection::Unbound(self.rootstore(), resource.as_ref() ,tsel.clone()); [INFO] [stdout] | ^^^^^^^^^^^^ help: try removing the `clone` call: `tsel` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `TextSelection` which implements the `Copy` trait [INFO] [stdout] --> src/api/transpose.rs:244:130 [INFO] [stdout] | [INFO] [stdout] 244 | ...store(), resource.as_ref() ,intersection.clone())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `intersection` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/transpose.rs:318:65 [INFO] [stdout] | [INFO] [stdout] 318 | let mapped_tsel = reftsel.textselection(&offset)?; [INFO] [stdout] | ^^^^^^^ help: change this to: `offset` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/api/transpose.rs:351:65 [INFO] [stdout] | [INFO] [stdout] 351 | let mapped_tsel = reftsel.textselection(&relative_offset)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: change this to: `relative_offset` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [WARN] too many lines in the log, truncating it