Skip to content

Commit

Permalink
Clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
magbak committed Dec 19, 2024
1 parent f568057 commit d0cba99
Show file tree
Hide file tree
Showing 23 changed files with 34 additions and 30 deletions.
2 changes: 1 addition & 1 deletion lib/chrontext/src/combiner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ pub struct Combiner {
}

impl Combiner {
pub fn new<'py>(
pub fn new(
sparql_database: Arc<dyn SparqlQueryable>,
pushdown_settings: HashSet<PushdownSetting>,
virtualized_database: Arc<VirtualizedDatabase>,
Expand Down
1 change: 1 addition & 0 deletions lib/chrontext/src/combiner/lazy_graph_patterns/extend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ use virtualized_query::VirtualizedQuery;

impl Combiner {
#[async_recursion]
#[allow(clippy::too_many_arguments)]
pub(crate) async fn lazy_extend(
&mut self,
inner: &GraphPattern,
Expand Down
5 changes: 3 additions & 2 deletions lib/chrontext/src/combiner/lazy_graph_patterns/group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ use std::collections::HashMap;
use virtualized_query::VirtualizedQuery;

impl Combiner {
#[allow(clippy::too_many_arguments)]
pub(crate) async fn lazy_group(
&mut self,
inner: &GraphPattern,
variables: &Vec<Variable>,
aggregates: &Vec<(Variable, AggregateExpression)>,
variables: &[Variable],
aggregates: &[(Variable, AggregateExpression)],
solution_mapping: Option<SolutionMappings>,
mut static_query_map: HashMap<Context, Query>,
mut prepared_virtualized_queries: Option<HashMap<Context, Vec<VirtualizedQuery>>>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use virtualized_query::VirtualizedQuery;

impl Combiner {
#[async_recursion]
#[allow(clippy::too_many_arguments)]
pub(crate) async fn lazy_left_join(
&mut self,
left: &GraphPattern,
Expand Down
1 change: 1 addition & 0 deletions lib/chrontext/src/combiner/lazy_graph_patterns/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use virtualized_query::VirtualizedQuery;

impl Combiner {
#[async_recursion]
#[allow(clippy::too_many_arguments)]
pub(crate) async fn lazy_slice(
&mut self,
inner: &GraphPattern,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use std::collections::HashMap;
impl TimeseriesQueryPrepper {
pub fn prepare_coalesce_expression(
&mut self,
wrapped: &Vec<Expression>,
wrapped: &[Expression],
try_groupby_complex_query: bool,
solution_mappings: &mut SolutionMappings,
context: &Context,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ impl TimeseriesQueryPrepper {
pub fn prepare_function_call_expression(
&mut self,
_fun: &Function,
args: &Vec<Expression>,
args: &[Expression],
try_groupby_complex_query: bool,
solution_mappings: &mut SolutionMappings,
context: &Context,
Expand Down
2 changes: 1 addition & 1 deletion lib/chrontext/src/preparing/expressions/in_expression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ impl TimeseriesQueryPrepper {
pub fn prepare_in_expression(
&mut self,
left: &Expression,
expressions: &Vec<Expression>,
expressions: &[Expression],
try_groupby_complex_query: bool,
solution_mappings: &mut SolutionMappings,
context: &Context,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ impl TimeseriesQueryPrepper {
fn add_grouping_col(
&mut self,
solution_mappings: &mut SolutionMappings,
by: &Vec<Variable>,
by: &[Variable],
) -> String {
let grouping_col = format!("{}_{}", GROUPING_COL, self.grouping_counter);
self.grouping_counter += 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ impl TimeseriesQueryPrepper {
pub fn prepare_project(
&mut self,
inner: &GraphPattern,
_variables: &Vec<Variable>,
_variables: &[Variable],
try_groupby_complex_query: bool,
solution_mappings: &mut SolutionMappings,
context: &Context,
Expand Down
4 changes: 2 additions & 2 deletions lib/chrontext/src/preparing/graph_patterns/values_pattern.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ use spargebra::term::GroundTerm;
impl TimeseriesQueryPrepper {
pub fn prepare_values(
&mut self,
_variables: &Vec<Variable>,
_bindings: &Vec<Vec<Option<GroundTerm>>>,
_variables: &[Variable],
_bindings: &[Vec<Option<GroundTerm>>],
) -> GPPrepReturn {
GPPrepReturn::new(HashMap::new())
}
Expand Down
4 changes: 2 additions & 2 deletions lib/chrontext/src/rewriting/expressions/and_expression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ impl StaticQueryRewriter {
&context.extension_with(PathEntry::AndRight),
);
let mut exr = ExReturn::new();
exr.with_is_subquery(&mut left_rewrite)
.with_is_subquery(&mut right_rewrite);
exr.with_is_subquery(&left_rewrite)
.with_is_subquery(&right_rewrite);
if left_rewrite.expression.is_some()
&& right_rewrite.expression.is_some()
&& left_rewrite.change_type.as_ref().unwrap() == &ChangeType::NoChange
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ impl StaticQueryRewriter {
&context.extension_with(right_path_entry),
);
let mut exr = ExReturn::new();
exr.with_is_subquery(&mut left_rewrite)
.with_is_subquery(&mut right_rewrite);
exr.with_is_subquery(&left_rewrite)
.with_is_subquery(&right_rewrite);
if left_rewrite.expression.is_some()
&& left_rewrite.change_type.as_ref().unwrap() == &ChangeType::NoChange
&& right_rewrite.expression.is_some()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::collections::HashSet;
impl StaticQueryRewriter {
pub fn rewrite_coalesce_expression(
&mut self,
wrapped: &Vec<Expression>,
wrapped: &[Expression],
variables_in_scope: &HashSet<Variable>,
create_subquery: bool,
context: &Context,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ impl StaticQueryRewriter {
pub fn rewrite_function_call_expression(
&mut self,
fun: &Function,
args: &Vec<Expression>,
args: &[Expression],
variables_in_scope: &HashSet<Variable>,
create_subquery: bool,
context: &Context,
Expand Down
8 changes: 4 additions & 4 deletions lib/chrontext/src/rewriting/expressions/if_expression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ impl StaticQueryRewriter {
create_subquery,
&context.extension_with(PathEntry::IfLeft),
);
let mut mid_rewrite = self.rewrite_expression(
let mid_rewrite = self.rewrite_expression(
mid,
&ChangeType::NoChange,
variables_in_scope,
Expand All @@ -38,9 +38,9 @@ impl StaticQueryRewriter {
&context.extension_with(PathEntry::IfRight),
);
let mut exr = ExReturn::new();
exr.with_is_subquery(&mut left_rewrite)
.with_is_subquery(&mut mid_rewrite)
.with_is_subquery(&mut right_rewrite);
exr.with_is_subquery(&left_rewrite)
.with_is_subquery(&mid_rewrite)
.with_is_subquery(&right_rewrite);
if left_rewrite.expression.is_some()
&& left_rewrite.change_type.as_ref().unwrap() == &ChangeType::NoChange
&& mid_rewrite.expression.is_some()
Expand Down
4 changes: 2 additions & 2 deletions lib/chrontext/src/rewriting/expressions/in_expression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ impl StaticQueryRewriter {
pub fn rewrite_in_expression(
&mut self,
left: &Expression,
expressions: &Vec<Expression>,
expressions: &[Expression],
required_change_direction: &ChangeType,
variables_in_scope: &HashSet<Variable>,
create_subquery: bool,
Expand All @@ -37,7 +37,7 @@ impl StaticQueryRewriter {
})
.collect::<Vec<ExReturn>>();
let mut exr = ExReturn::new();
exr.with_is_subquery(&mut left_rewrite);
exr.with_is_subquery(&left_rewrite);
for rw_exr in expressions_rewritten.iter_mut() {
exr.with_is_subquery(rw_exr);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/chrontext/src/rewriting/expressions/not_expression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ impl StaticQueryRewriter {
&context.extension_with(PathEntry::Not),
);
let mut exr = ExReturn::new();
exr.with_is_subquery(&mut wrapped_rewrite);
exr.with_is_subquery(&wrapped_rewrite);
if wrapped_rewrite.expression.is_some() {
let wrapped_change = wrapped_rewrite.change_type.take().unwrap();
let use_change_type = match wrapped_change {
Expand Down
4 changes: 2 additions & 2 deletions lib/chrontext/src/rewriting/expressions/or_expression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ impl StaticQueryRewriter {
&context.extension_with(PathEntry::OrRight),
);
let mut exr = ExReturn::new();
exr.with_is_subquery(&mut left_rewrite)
.with_is_subquery(&mut right_rewrite);
exr.with_is_subquery(&left_rewrite)
.with_is_subquery(&right_rewrite);
if left_rewrite.expression.is_some()
&& right_rewrite.expression.is_some()
&& left_rewrite.change_type.as_ref().unwrap() == &ChangeType::NoChange
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ impl StaticQueryRewriter {
&context.extension_with(path_entry),
);
let mut exr = ExReturn::new();
exr.with_is_subquery(&mut wrapped_rewrite);
exr.with_is_subquery(&wrapped_rewrite);
if wrapped_rewrite.expression.is_some()
&& wrapped_rewrite.change_type.as_ref().unwrap() == &ChangeType::NoChange
{
Expand Down
4 changes: 2 additions & 2 deletions lib/chrontext/src/rewriting/graph_patterns/group_pattern.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ impl StaticQueryRewriter {
pub fn rewrite_group(
&mut self,
graph_pattern: &GraphPattern,
variables: &Vec<Variable>,
aggregates: &Vec<(Variable, AggregateExpression)>,
variables: &[Variable],
aggregates: &[(Variable, AggregateExpression)],
context: &Context,
) -> GPReturn {
let inner_context = context.extension_with(PathEntry::GroupInner);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ impl StaticQueryRewriter {
pub fn rewrite_project(
&mut self,
inner: &GraphPattern,
variables: &Vec<Variable>,
variables: &[Variable],
context: &Context,
) -> GPReturn {
let mut inner_rewrite =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ impl StaticQueryRewriter {
pub fn rewrite_values(
&mut self,
variables: &[Variable],
bindings: &Vec<Vec<Option<GroundTerm>>>,
bindings: &[Vec<Option<GroundTerm>>],
) -> GPReturn {
GPReturn::new(
GraphPattern::Values {
Expand Down

0 comments on commit d0cba99

Please sign in to comment.