Skip to content

Commit

Permalink
Clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MinerSebas committed May 7, 2024
1 parent 2030251 commit 23c09ac
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/system_lints/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ fn recursively_resolve_system_param<'tcx>(

Some(SystemParamType::Tuple(vec))
} else if clippy_utils::ty::match_type(ctx, ty.middle, bevy_paths::QUERY) {
resolve_query(ctx, ty).map(|query| SystemParamType::Query(query))
resolve_query(ctx, ty).map(SystemParamType::Query)
} else {
None
}
Expand Down
12 changes: 6 additions & 6 deletions src/system_lints/query_lints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,11 +255,11 @@ struct QueryData<'tcx> {
}

impl<'tcx> QueryData<'tcx> {
fn fill_with_world_query(&mut self, ctx: &LateContext, world_query: &WorldQuery<'tcx>) {
fn fill_with_world_query(&mut self, world_query: &WorldQuery<'tcx>) {
match world_query {
WorldQuery::Tuple(world_querys, _) => {
for world_query in world_querys {
self.fill_with_world_query(ctx, world_query);
self.fill_with_world_query(world_query);
}
}
WorldQuery::Data(ty_kind, mutbl, span) => {
Expand All @@ -277,7 +277,7 @@ impl<'tcx> QueryData<'tcx> {
meta: QueryDataMeta::Option,
..Default::default()
};
world.fill_with_world_query(ctx, &world_query.0);
world.fill_with_world_query(&world_query.0);
self.option.push((world, *span));
}
}
Expand Down Expand Up @@ -571,8 +571,8 @@ fn contains_ty_kind<'tcx, T>(vec: &Vec<(TyKind<'tcx>, T)>, ty_kind: &TyKind<'tcx
false
}

fn keys<'t, 'tcx, T>(vec: &'t Vec<(TyKind<'tcx>, T)>) -> impl Iterator<Item = TyKind<'tcx>> + 't {
vec.into_iter().map(|(ty_kind, _)| *ty_kind)
fn keys<'t, 'tcx, T>(vec: &'t [(TyKind<'tcx>, T)]) -> impl Iterator<Item = TyKind<'tcx>> + 't {
vec.iter().map(|(ty_kind, _)| *ty_kind)
}

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
Expand All @@ -590,7 +590,7 @@ impl Default for QueryDataMeta {
pub(super) fn lint_query(ctx: &LateContext, query: Query) {
let query_data = {
let mut query_data = QueryData::default();
query_data.fill_with_world_query(ctx, &query.world_query);
query_data.fill_with_world_query(&query.world_query);
query_data.fill_with_filter_query(&query.filter_query);
query_data
};
Expand Down

0 comments on commit 23c09ac

Please sign in to comment.