diff --git a/lib/src/lib.rs b/lib/src/lib.rs index 547cf8d1..06d2aa96 100644 --- a/lib/src/lib.rs +++ b/lib/src/lib.rs @@ -67,7 +67,7 @@ clippy::explicit_iter_loop, clippy::expl_impl_clone_on_copy, clippy::fallible_impl_from, - clippy::filter_map, + clippy::manual_filter_map, clippy::filter_map_next, clippy::manual_find_map, clippy::get_unwrap, @@ -93,7 +93,6 @@ // clippy::panic, does not work well with tests clippy::path_buf_push_overwrite, clippy::print_stdout, - clippy::pub_enum_variant_names, //TODO clippy::redundant_closure_for_method_calls, // clippy::shadow_reuse, // clippy::shadow_same, @@ -107,8 +106,7 @@ clippy::unimplemented, clippy::unseparated_literal_suffix, clippy::used_underscore_binding, - clippy::wildcard_dependencies, - clippy::wrong_pub_self_convention, + clippy::wildcard_dependencies )] #![doc(test(attr(deny(warnings))))] diff --git a/lib/src/model/dataset.rs b/lib/src/model/dataset.rs index cd0536b7..51d64fb8 100644 --- a/lib/src/model/dataset.rs +++ b/lib/src/model/dataset.rs @@ -792,6 +792,7 @@ impl Dataset { } } + #[allow(clippy::needless_collect)] fn label( &mut self, hashes: &HashMap, diff --git a/lib/src/sparql/eval.rs b/lib/src/sparql/eval.rs index db5e8ce6..4bae3807 100644 --- a/lib/src/sparql/eval.rs +++ b/lib/src/sparql/eval.rs @@ -2079,7 +2079,7 @@ impl SimpleEvaluator { fn partial_cmp(&self, a: &EncodedTerm, b: &EncodedTerm) -> Option { if a == b { - return Some(Ordering::Equal); + Some(Ordering::Equal) } else if let EncodedTerm::Triple(a) = a { if let EncodedTerm::Triple(b) = b { match self.partial_cmp(&a.subject, &b.subject) { @@ -2616,7 +2616,7 @@ impl Iterator for BadLeftJoinIterator { type Item = Result; fn next(&mut self) -> Option> { - while let Some(right_tuple) = self.current_right.next() { + for right_tuple in &mut self.current_right { match right_tuple { Ok(right_tuple) => { if let Some(combined) = combine_tuples( @@ -2635,7 +2635,7 @@ impl Iterator for BadLeftJoinIterator { let mut filtered_left = left_tuple.clone(); unbind_variables(&mut filtered_left, &self.problem_vars); self.current_right = self.eval.eval_plan(&self.right_plan, filtered_left); - while let Some(right_tuple) = self.current_right.next() { + for right_tuple in &mut self.current_right { match right_tuple { Ok(right_tuple) => { if let Some(combined) = diff --git a/lib/src/sparql/service.rs b/lib/src/sparql/service.rs index 0fdc5dc5..cf3a391d 100644 --- a/lib/src/sparql/service.rs +++ b/lib/src/sparql/service.rs @@ -98,7 +98,6 @@ pub struct SimpleServiceHandler { } impl SimpleServiceHandler { - #[allow(dead_code)] pub fn new() -> Self { Self { client: Client::new(), diff --git a/testsuite/benches/sparql_query.rs b/testsuite/benches/sparql_query.rs index f0961308..a19c4392 100644 --- a/testsuite/benches/sparql_query.rs +++ b/testsuite/benches/sparql_query.rs @@ -28,7 +28,7 @@ fn sparql_w3c_syntax_bench(c: &mut Criterion) { c.bench_function("query parser", |b| { b.iter(|| { for (query, base) in &queries { - Query::parse(query, Some(&base)).unwrap(); + Query::parse(query, Some(base)).unwrap(); } }) }); diff --git a/testsuite/src/sparql_evaluator.rs b/testsuite/src/sparql_evaluator.rs index 253056c4..3a08f2d5 100644 --- a/testsuite/src/sparql_evaluator.rs +++ b/testsuite/src/sparql_evaluator.rs @@ -53,7 +53,7 @@ fn evaluate_positive_syntax_test(test: &Test) -> Result<()> { .action .as_deref() .ok_or_else(|| anyhow!("No action found for test {}", test))?; - match Query::parse(&read_file_to_string(&query_file)?, Some(&query_file)) { + match Query::parse(&read_file_to_string(query_file)?, Some(query_file)) { Err(error) => Err(anyhow!("Not able to parse {} with error: {}", test, error)), Ok(query) => match Query::parse(&query.to_string(), None) { Ok(_) => Ok(()), @@ -166,7 +166,7 @@ fn evaluate_positive_update_syntax_test(test: &Test) -> Result<()> { .action .as_deref() .ok_or_else(|| anyhow!("No action found for test {}", test))?; - match Update::parse(&read_file_to_string(&update_file)?, Some(&update_file)) { + match Update::parse(&read_file_to_string(update_file)?, Some(update_file)) { Err(error) => Err(anyhow!("Not able to parse {} with error: {}", test, error)), Ok(update) => match Update::parse(&update.to_string(), None) { Ok(_) => Ok(()), @@ -285,7 +285,7 @@ impl StaticServiceHandler { .map(|(name, data)| { let name = NamedNode::new(name)?; let store = Store::new()?; - load_to_store(&data, &store, &GraphName::DefaultGraph)?; + load_to_store(data, &store, &GraphName::DefaultGraph)?; Ok((name, store)) }) .collect::>()?, @@ -546,7 +546,7 @@ impl StaticQueryResults { } }) .collect::>(); - bindings.sort_by(|(a, _), (b, _)| a.cmp(&b)); + bindings.sort_by(|(a, _), (b, _)| a.cmp(b)); let index = graph .object_for_subject_predicate(solution, rs::INDEX) .and_then(|object| {