Skip to content

Improve performance of apply_update #49

Improve performance of apply_update

Improve performance of apply_update #49

Triggered via pull request November 21, 2023 15:15
Status Success
Total duration 9m 45s
Artifacts
This run and associated checks have been archived and are scheduled for deletion. Learn more about checks retention

code_coverage.yml

on: pull_request
Execute tests with code coverage
9m 34s
Execute tests with code coverage
Fit to window
Zoom out
Zoom in

Annotations

80 warnings
`Box::new(_)` of default value: capi/src/graph.rs#L139
warning: `Box::new(_)` of default value --> capi/src/graph.rs:139:23 | 139 | Box::into_raw(Box::new(vec![])) | ^^^^^^^^^^^^^^^^ help: try: `Box::default()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#box_default = note: `#[warn(clippy::box_default)]` on by default
creating a `Box` from a void raw pointer: capi/src/data.rs#L26
warning: creating a `Box` from a void raw pointer --> capi/src/data.rs:26:15 | 26 | let ptr = Box::from_raw(ptr); | ^^^^^^^^^^^^^^^^^^ | help: cast this to a pointer of the appropriate type --> capi/src/data.rs:26:29 | 26 | let ptr = Box::from_raw(ptr); | ^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_raw_with_void_ptr = note: `#[warn(clippy::from_raw_with_void_ptr)]` on by default
useless use of `format!`: cli/src/bin/bench_queries.rs#L109
warning: useless use of `format!` --> cli/src/bin/bench_queries.rs:109:16 | 109 | .help(&format!("Changes the default measurement time for this run. [default: 5]"))) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Changes the default measurement time for this run. [default: 5]".to_string()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format = note: `#[warn(clippy::useless_format)]` on by default
this `impl` can be derived: graphannis/src/annis/types.rs#L226
warning: this `impl` can be derived --> graphannis/src/annis/types.rs:226:1 | 226 | / impl Default for VisualizerVisibility { 227 | | fn default() -> Self { 228 | | VisualizerVisibility::Hidden 229 | | } 230 | | } | |_^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls = help: remove the manual implementation... help: ...and instead derive it... | 215 + #[derive(Default)] 216 | pub enum VisualizerVisibility { | help: ...and mark the default variant | 217 ~ #[default] 218 ~ Hidden, |
this `impl` can be derived: graphannis/src/annis/types.rs#L142
warning: this `impl` can be derived --> graphannis/src/annis/types.rs:142:1 | 142 | / impl Default for TimelineStrategy { 143 | | fn default() -> Self { 144 | | TimelineStrategy::Explicit 145 | | } 146 | | } | |_^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls = help: remove the manual implementation... help: ...and instead derive it... | 123 + #[derive(Default)] 124 | pub enum TimelineStrategy { | help: ...and mark the default variant | 126 ~ #[default] 127 ~ Explicit, |
explicit call to `.into_iter()` in function argument accepting `IntoIterator`: graphannis/src/annis/db/token_helper.rs#L48
warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` --> graphannis/src/annis/db/token_helper.rs:48:9 | 48 | / db.get_all_components(Some(AnnotationComponentType::Coverage), None) 49 | | .into_iter(), | |________________________^ help: consider removing the `.into_iter()`: `db.get_all_components(Some(AnnotationComponentType::Coverage), None)` | note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` --> /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/iter/traits/collect.rs:371:18 = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
returning the result of a `let` binding from a block: graphannis/src/annis/db/sort_matches.rs#L211
warning: returning the result of a `let` binding from a block --> graphannis/src/annis/db/sort_matches.rs:211:29 | 205 | / ... let v = gs_order.is_connected( 206 | | ... m1_lefttok, 207 | | ... m2_lefttok, 208 | | ... 1, 209 | | ... std::ops::Bound::Unbounded, 210 | | ... )?; | |_________________________- unnecessary `let` binding 211 | ... v | ^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return = note: `#[warn(clippy::let_and_return)]` on by default help: return the expression directly | 205 ~ 206 ~ gs_order.is_connected( 207 + m1_lefttok, 208 + m2_lefttok, 209 + 1, 210 + std::ops::Bound::Unbounded, 211 + )? |
using `clone` on type `Option<u64>` which implements the `Copy` trait: graphannis/src/annis/db/sort_matches.rs#L196
warning: using `clone` on type `Option<u64>` which implements the `Copy` trait --> graphannis/src/annis/db/sort_matches.rs:196:51 | 196 | cache.left_token.put(m2.node, result.clone()); | ^^^^^^^^^^^^^^ help: try removing the `clone` call: `result` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
using `clone` on type `Option<u64>` which implements the `Copy` trait: graphannis/src/annis/db/sort_matches.rs#L193
warning: using `clone` on type `Option<u64>` which implements the `Copy` trait --> graphannis/src/annis/db/sort_matches.rs:193:21 | 193 | lefttok.clone() | ^^^^^^^^^^^^^^^ help: try removing the `clone` call: `lefttok` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
using `clone` on type `Option<u64>` which implements the `Copy` trait: graphannis/src/annis/db/sort_matches.rs#L188
warning: using `clone` on type `Option<u64>` which implements the `Copy` trait --> graphannis/src/annis/db/sort_matches.rs:188:51 | 188 | cache.left_token.put(m1.node, result.clone()); | ^^^^^^^^^^^^^^ help: try removing the `clone` call: `result` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
using `clone` on type `Option<u64>` which implements the `Copy` trait: graphannis/src/annis/db/sort_matches.rs#L185
warning: using `clone` on type `Option<u64>` which implements the `Copy` trait --> graphannis/src/annis/db/sort_matches.rs:185:21 | 185 | lefttok.clone() | ^^^^^^^^^^^^^^^ help: try removing the `clone` call: `lefttok` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy = note: `#[warn(clippy::clone_on_copy)]` on by default
this function has too many arguments (8/7): graphannis/src/annis/db/sort_matches.rs#L134
warning: this function has too many arguments (8/7) --> graphannis/src/annis/db/sort_matches.rs:134:1 | 134 | / pub fn compare_match_by_text_pos( 135 | | m1: &Match, 136 | | m2: &Match, 137 | | node_annos: &dyn NodeAnnotationStorage, ... | 142 | | cache: &mut SortCache, 143 | | ) -> Result<Ordering> { | |_____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
this function has too many arguments (8/7): graphannis/src/annis/db/sort_matches.rs#L35
warning: this function has too many arguments (8/7) --> graphannis/src/annis/db/sort_matches.rs:35:1 | 35 | / pub fn compare_matchgroup_by_text_pos( 36 | | m1: &[Match], 37 | | m2: &[Match], 38 | | node_annos: &dyn NodeAnnotationStorage, ... | 43 | | cache: &mut SortCache, 44 | | ) -> Result<Ordering> { | |_____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
useless conversion to the same type: `std::string::String`: graphannis/src/annis/db/relannis.rs#L2152
warning: useless conversion to the same type: `std::string::String` --> graphannis/src/annis/db/relannis.rs:2152:30 | 2152 | target_node: parent_path.into(), | ^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `parent_path` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
the following explicit lifetimes could be elided: 'a: graphannis/src/annis/db/relannis.rs#L856
warning: the following explicit lifetimes could be elided: 'a --> graphannis/src/annis/db/relannis.rs:856:23 | 856 | fn get_field_not_null<'a>( | ^^ 857 | record: &'a csv::StringRecord, | ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 856 ~ fn get_field_not_null( 857 ~ record: &csv::StringRecord, |
the following explicit lifetimes could be elided: 'a: graphannis/src/annis/db/relannis.rs#L791
warning: the following explicit lifetimes could be elided: 'a --> graphannis/src/annis/db/relannis.rs:791:14 | 791 | fn get_field<'a>( | ^^ 792 | record: &'a csv::StringRecord, | ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 791 ~ fn get_field( 792 ~ record: &csv::StringRecord, |
dereferencing a tuple pattern where every element takes a reference: graphannis/src/annis/db/exec/parallel/nestedloop.rs#L43
warning: dereferencing a tuple pattern where every element takes a reference --> graphannis/src/annis/db/exec/parallel/nestedloop.rs:43:42 | 43 | if let (&Some(ref cost_lhs), &Some(ref cost_rhs)) = (&desc_lhs.cost, &desc_rhs.cost) { | ^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference help: try removing the `&` and `ref` parts | 43 - if let (&Some(ref cost_lhs), &Some(ref cost_rhs)) = (&desc_lhs.cost, &desc_rhs.cost) { 43 + if let (&Some(ref cost_lhs), Some(cost_rhs)) = (&desc_lhs.cost, &desc_rhs.cost) { |
dereferencing a tuple pattern where every element takes a reference: graphannis/src/annis/db/exec/parallel/nestedloop.rs#L43
warning: dereferencing a tuple pattern where every element takes a reference --> graphannis/src/annis/db/exec/parallel/nestedloop.rs:43:21 | 43 | if let (&Some(ref cost_lhs), &Some(ref cost_rhs)) = (&desc_lhs.cost, &desc_rhs.cost) { | ^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference help: try removing the `&` and `ref` parts | 43 - if let (&Some(ref cost_lhs), &Some(ref cost_rhs)) = (&desc_lhs.cost, &desc_rhs.cost) { 43 + if let (Some(cost_lhs), &Some(ref cost_rhs)) = (&desc_lhs.cost, &desc_rhs.cost) { |
this function has too many arguments (8/7): graphannis/src/annis/db/exec/nodesearch.rs#L800
warning: this function has too many arguments (8/7) --> graphannis/src/annis/db/exec/nodesearch.rs:800:5 | 800 | / fn new_tokensearch( 801 | | db: &'a AnnotationGraph, 802 | | val: ValueSearch<String>, 803 | | filters: Vec<MatchValueFilterFunc>, ... | 808 | | timeout: TimeoutCheck, 809 | | ) -> Result<NodeSearch<'a>> { | |_______________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
this function has too many arguments (8/7): graphannis/src/annis/db/exec/nodesearch.rs#L703
warning: this function has too many arguments (8/7) --> graphannis/src/annis/db/exec/nodesearch.rs:703:5 | 703 | / fn new_annosearch_regex( 704 | | db: &'a AnnotationGraph, 705 | | qname: (Option<String>, String), 706 | | pattern: &str, ... | 711 | | timeout: TimeoutCheck, 712 | | ) -> Result<NodeSearch<'a>> { | |_______________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
this function has too many arguments (8/7): graphannis/src/annis/db/exec/nodesearch.rs#L599
warning: this function has too many arguments (8/7) --> graphannis/src/annis/db/exec/nodesearch.rs:599:5 | 599 | / fn new_annosearch_exact( 600 | | db: &'a AnnotationGraph, 601 | | qname: (Option<String>, String), 602 | | val: ValueSearch<String>, ... | 607 | | timeout: TimeoutCheck, 608 | | ) -> Result<NodeSearch<'a>> { | |_______________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
dereferencing a tuple pattern where every element takes a reference: graphannis/src/annis/db/exec/nestedloop.rs#L35
warning: dereferencing a tuple pattern where every element takes a reference --> graphannis/src/annis/db/exec/nestedloop.rs:35:42 | 35 | if let (&Some(ref cost_lhs), &Some(ref cost_rhs)) = (&desc_lhs.cost, &desc_rhs.cost) { | ^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference help: try removing the `&` and `ref` parts | 35 - if let (&Some(ref cost_lhs), &Some(ref cost_rhs)) = (&desc_lhs.cost, &desc_rhs.cost) { 35 + if let (&Some(ref cost_lhs), Some(cost_rhs)) = (&desc_lhs.cost, &desc_rhs.cost) { |
dereferencing a tuple pattern where every element takes a reference: graphannis/src/annis/db/exec/nestedloop.rs#L35
warning: dereferencing a tuple pattern where every element takes a reference --> graphannis/src/annis/db/exec/nestedloop.rs:35:21 | 35 | if let (&Some(ref cost_lhs), &Some(ref cost_rhs)) = (&desc_lhs.cost, &desc_rhs.cost) { | ^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference help: try removing the `&` and `ref` parts | 35 - if let (&Some(ref cost_lhs), &Some(ref cost_rhs)) = (&desc_lhs.cost, &desc_rhs.cost) { 35 + if let (Some(cost_lhs), &Some(ref cost_rhs)) = (&desc_lhs.cost, &desc_rhs.cost) { |
the following explicit lifetimes could be elided: 'a: graphannis/src/annis/db/exec/mod.rs#L224
warning: the following explicit lifetimes could be elided: 'a --> graphannis/src/annis/db/exec/mod.rs:224:22 | 224 | fn as_nodesearch<'a>(&'a self) -> Option<&'a NodeSearch> { | ^^ ^^ ^^ ^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 224 - fn as_nodesearch<'a>(&'a self) -> Option<&'a NodeSearch> { 224 + fn as_nodesearch(&self) -> Option<&NodeSearch> { |
the following explicit lifetimes could be elided: 'a: graphannis/src/annis/db/exec/mod.rs#L197
warning: the following explicit lifetimes could be elided: 'a --> graphannis/src/annis/db/exec/mod.rs:197:22 | 197 | fn as_nodesearch<'a>(&'a self) -> Option<&'a NodeSearch> { | ^^ ^^ ^^ ^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 197 - fn as_nodesearch<'a>(&'a self) -> Option<&'a NodeSearch> { 197 + fn as_nodesearch(&self) -> Option<&NodeSearch> { |
dereferencing a tuple pattern where every element takes a reference: graphannis/src/annis/db/exec/mod.rs#L112
warning: dereferencing a tuple pattern where every element takes a reference --> graphannis/src/annis/db/exec/mod.rs:112:42 | 112 | if let (&Some(ref cost_lhs), &Some(ref cost_rhs)) = (&lhs.cost, &rhs.cost) { | ^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference help: try removing the `&` and `ref` parts | 112 - if let (&Some(ref cost_lhs), &Some(ref cost_rhs)) = (&lhs.cost, &rhs.cost) { 112 + if let (&Some(ref cost_lhs), Some(cost_rhs)) = (&lhs.cost, &rhs.cost) { |
dereferencing a tuple pattern where every element takes a reference: graphannis/src/annis/db/exec/mod.rs#L112
warning: dereferencing a tuple pattern where every element takes a reference --> graphannis/src/annis/db/exec/mod.rs:112:21 | 112 | if let (&Some(ref cost_lhs), &Some(ref cost_rhs)) = (&lhs.cost, &rhs.cost) { | ^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference help: try removing the `&` and `ref` parts | 112 - if let (&Some(ref cost_lhs), &Some(ref cost_rhs)) = (&lhs.cost, &rhs.cost) { 112 + if let (Some(cost_lhs), &Some(ref cost_rhs)) = (&lhs.cost, &rhs.cost) { |
the borrowed expression implements the required traits: graphannis/src/annis/db/corpusstorage.rs#L2669
warning: the borrowed expression implements the required traits --> graphannis/src/annis/db/corpusstorage.rs:2669:29 | 2669 | std::fs::create_dir_all(&db_dir).map_err(|e| CorpusStorageError::LockCorpusDirectory { | ^^^^^^^ help: change this to: `db_dir` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
dereferencing a tuple pattern where every element takes a reference: graphannis/src/annis/db/corpusstorage.rs#L2472
warning: dereferencing a tuple pattern where every element takes a reference --> graphannis/src/annis/db/corpusstorage.rs:2472:13 | 2472 | let &(ref lock, ref cvar) = &*self.active_background_workers; | ^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference help: try removing the `&` and `ref` parts | 2472 - let &(ref lock, ref cvar) = &*self.active_background_workers; 2472 + let (lock, cvar) = &*self.active_background_workers; |
this function has too many arguments (8/7): graphannis/src/annis/db/corpusstorage.rs#L1629
warning: this function has too many arguments (8/7) --> graphannis/src/annis/db/corpusstorage.rs:1629:5 | 1629 | / fn create_find_iterator_for_query<'b>( 1630 | | &'b self, 1631 | | db: &'b AnnotationGraph, 1632 | | query: &'b Disjunction, ... | 1637 | | timeout: TimeoutCheck, 1638 | | ) -> Result<(FindIterator<'b>, Option<usize>)> { | |__________________________________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
explicit call to `.into_iter()` in function argument accepting `IntoIterator`: graphannis/src/annis/db/corpusstorage.rs#L1432
warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` --> graphannis/src/annis/db/corpusstorage.rs:1432:28 | 1432 | missing.extend(additional_components.into_iter()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `additional_components` | note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` --> /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/iter/traits/collect.rs:371:18 = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion = note: `#[warn(clippy::useless_conversion)]` on by default
dereferencing a tuple pattern where every element takes a reference: graphannis/src/annis/db/corpusstorage.rs#L1394
warning: dereferencing a tuple pattern where every element takes a reference --> graphannis/src/annis/db/corpusstorage.rs:1394:17 | 1394 | let &(ref lock, ref cvar) = &*active_background_workers; | ^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference help: try removing the `&` and `ref` parts | 1394 - let &(ref lock, ref cvar) = &*active_background_workers; 1394 + let (lock, cvar) = &*active_background_workers; |
dereferencing a tuple pattern where every element takes a reference: graphannis/src/annis/db/corpusstorage.rs#L1379
warning: dereferencing a tuple pattern where every element takes a reference --> graphannis/src/annis/db/corpusstorage.rs:1379:17 | 1379 | let &(ref lock, ref _cvar) = &*active_background_workers; | ^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference = note: `#[warn(clippy::needless_borrowed_reference)]` on by default help: try removing the `&` and `ref` parts | 1379 - let &(ref lock, ref _cvar) = &*active_background_workers; 1379 + let (lock, _cvar) = &*active_background_workers; |
unneeded `return` statement: graphannis/src/annis/db/corpusstorage.rs#L1357
warning: unneeded `return` statement --> graphannis/src/annis/db/corpusstorage.rs:1357:13 | 1357 | return Ok(false); | ^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return = note: `#[warn(clippy::needless_return)]` on by default help: remove `return` | 1357 - return Ok(false); 1357 + Ok(false) |
the borrowed expression implements the required traits: graphannis/src/annis/db/corpusstorage.rs#L1062
warning: the borrowed expression implements the required traits --> graphannis/src/annis/db/corpusstorage.rs:1062:67 | 1062 | let relative_path = new_path.strip_prefix(&new_base_path)?; | ^^^^^^^^^^^^^^ help: change this to: `new_base_path` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default
this `impl` can be derived: graphannis/src/annis/db/corpusstorage.rs#L263
warning: this `impl` can be derived --> graphannis/src/annis/db/corpusstorage.rs:263:1 | 263 | / impl Default for QueryLanguage { 264 | | fn default() -> Self { 265 | | QueryLanguage::AQL 266 | | } 267 | | } | |_^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls = help: remove the manual implementation... help: ...and instead derive it... | 257 + #[derive(Default)] 258 | pub enum QueryLanguage { | help: ...and mark the default variant | 258 ~ #[default] 259 ~ AQL, |
this `impl` can be derived: graphannis/src/annis/db/corpusstorage.rs#L210
warning: this `impl` can be derived --> graphannis/src/annis/db/corpusstorage.rs:210:1 | 210 | / impl Default for ResultOrder { 211 | | fn default() -> Self { 212 | | ResultOrder::Normal 213 | | } 214 | | } | |_^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls = note: `#[warn(clippy::derivable_impls)]` on by default = help: remove the manual implementation... help: ...and instead derive it... | 198 + #[derive(Default)] 199 | pub enum ResultOrder { | help: ...and mark the default variant | 200 ~ #[default] 201 ~ Normal, |
this expression creates a reference which is immediately dereferenced by the compiler: graphannis/src/annis/db/corpusstorage/subgraph.rs#L474
warning: this expression creates a reference which is immediately dereferenced by the compiler --> graphannis/src/annis/db/corpusstorage/subgraph.rs:474:41 | 474 | let token_helper = TokenHelper::new(&orig_graph).ok(); | ^^^^^^^^^^^ help: change this to: `orig_graph` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow = note: `#[warn(clippy::needless_borrow)]` on by default
redundant closure: graphannis/src/annis/db/corpusstorage/subgraph.rs#L435
warning: redundant closure --> graphannis/src/annis/db/corpusstorage/subgraph.rs:435:14 | 435 | .map(|n| Ok(n)) | ^^^^^^^^^ help: replace the closure with the function itself: `Ok` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
redundant closure: graphannis/src/annis/db/corpusstorage/subgraph.rs#L406
warning: redundant closure --> graphannis/src/annis/db/corpusstorage/subgraph.rs:406:41 | 406 | Ok(Box::new(parents.into_iter().map(|p| Ok(p)))) | ^^^^^^^^^ help: replace the closure with the function itself: `Ok` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure = note: `#[warn(clippy::redundant_closure)]` on by default
use of `flat_map` with an identity function: graphannis/src/annis/db/corpusstorage/subgraph.rs#L381
warning: use of `flat_map` with an identity function --> graphannis/src/annis/db/corpusstorage/subgraph.rs:381:40 | 381 | let result = iterators.into_iter().flat_map(|it| it); | ^^^^^^^^^^^^^^^^^ help: try: `flatten()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#flat_map_identity = note: `#[warn(clippy::flat_map_identity)]` on by default
deref which would be done by auto-deref: graphannis/src/annis/db/aql/operators/edge_op.rs#L181
warning: deref which would be done by auto-deref --> graphannis/src/annis/db/aql/operators/edge_op.rs:181:36 | 181 | if re.is_match(&*a.val) { | ^^^^^^^ help: try: `&a.val` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref
deref which would be done by auto-deref: graphannis/src/annis/db/aql/operators/edge_op.rs#L154
warning: deref which would be done by auto-deref --> graphannis/src/annis/db/aql/operators/edge_op.rs:154:37 | 154 | if !re.is_match(&*a.val) { | ^^^^^^^ help: try: `&a.val` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref = note: `#[warn(clippy::explicit_auto_deref)]` on by default
parameter is only used in recursion: graphannis/src/annis/db/aql/model.rs#L239
warning: parameter is only used in recursion --> graphannis/src/annis/db/aql/model.rs:239:10 | 239 | &self, | ^^^^ | note: parameter used here --> graphannis/src/annis/db/aql/model.rs:272:49 | 272 | indirectly_covered_token.extend(self.calculate_inherited_coverage_edges( | ^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#only_used_in_recursion = note: `#[warn(clippy::only_used_in_recursion)]` on by default
iterating on a map's values: graphannis/src/annis/db/aql/conjunction.rs#L839
warning: iterating on a map's values --> graphannis/src/annis/db/aql/conjunction.rs:839:9 | 839 | / component2exec 840 | | .into_iter() 841 | | .map(|(_cid, exec)| exec) | |_____________________________________^ help: try: `component2exec.into_values()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map = note: `#[warn(clippy::iter_kv_map)]` on by default
this function has too many arguments (8/7): graphannis/src/annis/db/aql/conjunction.rs#L592
warning: this function has too many arguments (8/7) --> graphannis/src/annis/db/aql/conjunction.rs:592:5 | 592 | / fn add_node_to_exec_plan<'a>( 593 | | &'a self, 594 | | node_nr: usize, 595 | | g: &'a AnnotationGraph, ... | 603 | | timeout: TimeoutCheck, 604 | | ) -> Result<()> { | |___________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments = note: `#[warn(clippy::too_many_arguments)]` on by default
call to `reserve` immediately after creation: graphannis/src/annis/db/aql/conjunction.rs#L471
warning: call to `reserve` immediately after creation --> graphannis/src/annis/db/aql/conjunction.rs:471:13 | 471 | / let mut family_operators: Vec<Vec<usize>> = Vec::new(); 472 | | family_operators.reserve(num_new_generations + 1); | |______________________________________________________________^ help: consider using `Vec::with_capacity(/* Space hint */)`: `let mut family_operators: Vec<Vec<usize>> = Vec::with_capacity(num_new_generations + 1);` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#reserve_after_initialization = note: `#[warn(clippy::reserve_after_initialization)]` on by default
the following explicit lifetimes could be elided: 'b: graphannis/src/annis/util/sortablecontainer.rs#L69
warning: the following explicit lifetimes could be elided: 'b --> graphannis/src/annis/util/sortablecontainer.rs:69:16 | 69 | fn try_get<'b>(&'b self, index: usize) -> Result<Cow<'b, T>> { | ^^ ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 69 - fn try_get<'b>(&'b self, index: usize) -> Result<Cow<'b, T>> { 69 + fn try_get(&self, index: usize) -> Result<Cow<'_, T>> { |
the following explicit lifetimes could be elided: 'b: graphannis/src/annis/util/sortablecontainer.rs#L40
warning: the following explicit lifetimes could be elided: 'b --> graphannis/src/annis/util/sortablecontainer.rs:40:16 | 40 | fn try_get<'b>(&'b self, index: usize) -> Result<Cow<'b, T>> { | ^^ ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 40 - fn try_get<'b>(&'b self, index: usize) -> Result<Cow<'b, T>> { 40 + fn try_get(&self, index: usize) -> Result<Cow<'_, T>> { |
the following explicit lifetimes could be elided: 'b: graphannis/src/annis/util/sortablecontainer.rs#L14
warning: the following explicit lifetimes could be elided: 'b --> graphannis/src/annis/util/sortablecontainer.rs:14:16 | 14 | fn try_get<'b>(&'b self, index: usize) -> Result<Cow<'b, T>>; | ^^ ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes = note: `#[warn(clippy::needless_lifetimes)]` on by default help: elide the lifetimes | 14 - fn try_get<'b>(&'b self, index: usize) -> Result<Cow<'b, T>>; 14 + fn try_get(&self, index: usize) -> Result<Cow<'_, T>>; |
this `else` branch is empty: graphannis/src/annis/db/corpusstorage.rs#L1290
warning: this `else` branch is empty --> graphannis/src/annis/db/corpusstorage.rs:1290:23 | 1290 | } else { | _______________________^ 1291 | | }; | |_____________________^ help: you can remove it | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_else = note: `#[warn(clippy::needless_else)]` on by default
the borrowed expression implements the required traits: core/src/util/disk_collections.rs#L362
warning: the borrowed expression implements the required traits --> core/src/util/disk_collections.rs:362:19 | 362 | .open(&location)?; | ^^^^^^^^^ help: change this to: `location` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
use of `default` to create a unit struct: core/src/types.rs#L240
warning: use of `default` to create a unit struct --> core/src/types.rs:240:60 | 240 | phantom: std::marker::PhantomData::<CT>::default(), | ^^^^^^^^^^^ help: remove this call to `default` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs
use of `default` to create a unit struct: core/src/types.rs#L207
warning: use of `default` to create a unit struct --> core/src/types.rs:207:52 | 207 | phantom: std::marker::PhantomData::<CT>::default(), | ^^^^^^^^^^^ help: remove this call to `default` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs = note: `#[warn(clippy::default_constructed_unit_structs)]` on by default
deref which would be done by auto-deref: core/src/graph/mod.rs#L1048
warning: deref which would be done by auto-deref --> core/src/graph/mod.rs:1048:47 | 1048 | let cached_size: &mut Option<usize> = &mut *lock; | ^^^^^^^^^^ help: try: `&mut lock` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref
deref which would be done by auto-deref: core/src/graph/mod.rs#L1037
warning: deref which would be done by auto-deref --> core/src/graph/mod.rs:1037:47 | 1037 | let cached_size: &mut Option<usize> = &mut *lock; | ^^^^^^^^^^ help: try: `&mut lock` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref = note: `#[warn(clippy::explicit_auto_deref)]` on by default
unnecessarily eager cloning of iterator items: core/src/graph/mod.rs#L1015
warning: unnecessarily eager cloning of iterator items --> core/src/graph/mod.rs:1015:17 | 1015 | / self.components 1016 | | .keys() 1017 | | .cloned() 1018 | | .filter(move |c: &Component<CT>| { ... | 1029 | | true 1030 | | }); | |______________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_overeager_cloned = note: `#[warn(clippy::iter_overeager_cloned)]` on by default help: try | 1016 ~ .keys().filter(move |&c: &Component<CT>| { 1017 + if let Some(ctype) = ctype.clone() { 1018 + if ctype != c.get_type() { 1019 + return false; 1020 + } 1021 + } 1022 + if let Some(name) = name { 1023 + if name != c.name { 1024 + return false; 1025 + } 1026 + } 1027 + true 1028 ~ }).cloned(); |
the borrowed expression implements the required traits: core/src/graph/storage/mod.rs#L170
warning: the borrowed expression implements the required traits --> core/src/graph/storage/mod.rs:170:40 | 170 | let f_data = std::fs::File::create(&data_path)?; | ^^^^^^^^^^ help: change this to: `data_path` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
the borrowed expression implements the required traits: core/src/graph/storage/disk_adjacency.rs#L187
warning: the borrowed expression implements the required traits --> core/src/graph/storage/disk_adjacency.rs:187:45 | 187 | let f_stats = std::fs::File::create(&stats_path)?; | ^^^^^^^^^^^ help: change this to: `stats_path` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
the borrowed expression implements the required traits: core/src/graph/storage/disk_adjacency.rs#L151
warning: the borrowed expression implements the required traits --> core/src/graph/storage/disk_adjacency.rs:151:43 | 151 | let f_stats = std::fs::File::open(&stats_path)?; | ^^^^^^^^^^^ help: change this to: `stats_path` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default
iterating on a map's values: core/src/graph/storage/disk_adjacency.rs#L40
warning: iterating on a map's values --> core/src/graph/storage/disk_adjacency.rs:40:36 | 40 | let mut fan_outs: Vec<usize> = fan_outs.into_iter().map(|(_, s)| s).collect(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `fan_outs.into_values()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map = note: `#[warn(clippy::iter_kv_map)]` on by default
use of `or_insert_with` to construct default value: core/src/graph/storage/dense_adjacency.rs#L190
warning: use of `or_insert_with` to construct default value --> core/src/graph/storage/dense_adjacency.rs:190:30 | 190 | ... .or_insert_with(Vec::default); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default
use of `or_insert_with` to construct default value: core/src/graph/storage/adjacencylist.rs#L264
warning: use of `or_insert_with` to construct default value --> core/src/graph/storage/adjacencylist.rs:264:63 | 264 | let regular_entry = self.edges.entry(edge.source).or_insert_with(Vec::default); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default
use of `or_insert_with` to construct default value: core/src/graph/storage/adjacencylist.rs#L258
warning: use of `or_insert_with` to construct default value --> core/src/graph/storage/adjacencylist.rs:258:18 | 258 | .or_insert_with(Vec::default); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default
this expression creates a reference which is immediately dereferenced by the compiler: core/src/annostorage/ondisk.rs#L1012
warning: this expression creates a reference which is immediately dereferenced by the compiler --> core/src/annostorage/ondisk.rs:1012:87 | 1012 | let upper_bound = create_by_anno_qname_key(NodeID::MAX, node_name_symbol, &node_name); | ^^^^^^^^^^ help: change this to: `node_name` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
this expression creates a reference which is immediately dereferenced by the compiler: core/src/annostorage/ondisk.rs#L997
warning: this expression creates a reference which is immediately dereferenced by the compiler --> core/src/annostorage/ondisk.rs:997:87 | 997 | let upper_bound = create_by_anno_qname_key(NodeID::MAX, node_name_symbol, &node_name); | ^^^^^^^^^^ help: change this to: `node_name` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
use of `or_insert_with` to construct default value: core/src/annostorage/ondisk.rs#L917
warning: use of `or_insert_with` to construct default value --> core/src/annostorage/ondisk.rs:917:18 | 917 | .or_insert_with(std::vec::Vec::new); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default
this expression creates a reference which is immediately dereferenced by the compiler: core/src/annostorage/ondisk.rs#L786
warning: this expression creates a reference which is immediately dereferenced by the compiler --> core/src/annostorage/ondisk.rs:786:54 | 786 | let val_prefix = std::str::from_utf8(&val_prefix); | ^^^^^^^^^^^ help: change this to: `val_prefix` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
needlessly taken reference of both operands: core/src/annostorage/ondisk.rs#L613
warning: needlessly taken reference of both operands --> core/src/annostorage/ondisk.rs:613:32 | 613 | ... if &item_value != &value { | ^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref help: use the values directly | 613 | if item_value != value { | ~~~~~~~~~~ ~~~~~
this lifetime isn't used in the impl: core/src/annostorage/ondisk.rs#L299
warning: this lifetime isn't used in the impl --> core/src/annostorage/ondisk.rs:299:6 | 299 | impl<'de, T> AnnotationStorage<T> for AnnoStorageImpl<T> | ^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes
this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec`: core/src/annostorage/inmemory.rs#L965
warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec` --> core/src/annostorage/inmemory.rs:965:37 | 965 | return Ok(items.into_iter().copied().next()); | ^^^^^^^^^ help: call directly: `iter` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref = note: `#[warn(clippy::into_iter_on_ref)]` on by default
use of `or_insert_with` to construct default value: core/src/annostorage/inmemory.rs#L899
warning: use of `or_insert_with` to construct default value --> core/src/annostorage/inmemory.rs:899:26 | 899 | .or_insert_with(std::vec::Vec::new); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default
this expression creates a reference which is immediately dereferenced by the compiler: core/src/annostorage/inmemory.rs#L760
warning: this expression creates a reference which is immediately dereferenced by the compiler --> core/src/annostorage/inmemory.rs:760:54 | 760 | let val_prefix = std::str::from_utf8(&val_prefix); | ^^^^^^^^^^^ help: change this to: `val_prefix` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow = note: `#[warn(clippy::needless_borrow)]` on by default
needlessly taken reference of both operands: core/src/annostorage/inmemory.rs#L584
warning: needlessly taken reference of both operands --> core/src/annostorage/inmemory.rs:584:32 | 584 | ... if &item_value != &value { | ^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref = note: `#[warn(clippy::op_ref)]` on by default help: use the values directly | 584 | if item_value != value { | ~~~~~~~~~~ ~~~~~
use of `or_insert_with` to construct default value: core/src/annostorage/inmemory.rs#L265
warning: use of `or_insert_with` to construct default value --> core/src/annostorage/inmemory.rs:265:14 | 265 | .or_insert_with(FxHashMap::default) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default
use of `or_insert_with` to construct default value: core/src/annostorage/inmemory.rs#L267
warning: use of `or_insert_with` to construct default value --> core/src/annostorage/inmemory.rs:267:14 | 267 | .or_insert_with(Vec::default) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default
use of `or_insert_with` to construct default value: core/src/annostorage/inmemory.rs#L233
warning: use of `or_insert_with` to construct default value --> core/src/annostorage/inmemory.rs:233:18 | 233 | .or_insert_with(Vec::new); | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default = note: `#[warn(clippy::unwrap_or_default)]` on by default
this lifetime isn't used in the impl: core/src/annostorage/inmemory.rs#L135
warning: this lifetime isn't used in the impl --> core/src/annostorage/inmemory.rs:135:6 | 135 | impl<'de_impl, T> AnnoStorageImpl<T> | ^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes
this lifetime isn't used in the impl: core/src/annostorage/inmemory.rs#L47
warning: this lifetime isn't used in the impl --> core/src/annostorage/inmemory.rs:47:9 | 47 | 'de_impl, | ^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes = note: `#[warn(clippy::extra_unused_lifetimes)]` on by default
Execute tests with code coverage
The following actions uses node12 which is deprecated and will be forced to run on node16: actions/cache@v2. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/