Skip to content

Commit

Permalink
Suppress clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralith committed Sep 29, 2023
1 parent 7dd62e5 commit 48fffbe
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,7 @@ pub struct QueryMut<'q, Q: Query> {
}

impl<'q, Q: Query> QueryMut<'q, Q> {
#[allow(clippy::needless_pass_by_ref_mut)] // https://github.com/rust-lang/rust-clippy/issues/11586

Check failure on line 842 in src/query.rs

View workflow job for this annotation

GitHub Actions / lint

unknown lint: `clippy::needless_pass_by_ref_mut`
pub(crate) fn new(world: &'q mut World) -> Self {
assert_borrow::<Q>();

Expand Down Expand Up @@ -1178,6 +1179,7 @@ impl<Q: Query> PreparedQuery<Q> {
/// Query a uniquely borrowed world
///
/// Avoids the cost of the dynamic borrow checking performed by [`query`][Self::query].
#[allow(clippy::needless_pass_by_ref_mut)] // https://github.com/rust-lang/rust-clippy/issues/11586

Check failure on line 1182 in src/query.rs

View workflow job for this annotation

GitHub Actions / lint

unknown lint: `clippy::needless_pass_by_ref_mut`
pub fn query_mut<'q>(&'q mut self, world: &'q mut World) -> PreparedQueryIter<'q, Q> {
assert_borrow::<Q>();

Expand All @@ -1192,6 +1194,7 @@ impl<Q: Query> PreparedQuery<Q> {
}

/// Provide random access to query results for a uniquely borrow world
#[allow(clippy::needless_pass_by_ref_mut)] // https://github.com/rust-lang/rust-clippy/issues/11586

Check failure on line 1197 in src/query.rs

View workflow job for this annotation

GitHub Actions / lint

unknown lint: `clippy::needless_pass_by_ref_mut`
pub fn view_mut<'q>(&'q mut self, world: &'q mut World) -> PreparedView<'q, Q> {
assert_borrow::<Q>();

Expand Down Expand Up @@ -1238,12 +1241,12 @@ impl<'q, Q: Query> PreparedQueryBorrow<'q, Q> {

/// Execute the prepared query
// The lifetime narrowing here is required for soundness.
pub fn iter<'i>(&'i mut self) -> PreparedQueryIter<'i, Q> {
pub fn iter(&mut self) -> PreparedQueryIter<'_, Q> {
unsafe { PreparedQueryIter::new(self.meta, self.archetypes, self.state.iter()) }
}

/// Provides random access to the results of the prepared query
pub fn view<'i>(&'i mut self) -> PreparedView<'i, Q> {
pub fn view(&mut self) -> PreparedView<'_, Q> {
unsafe { PreparedView::new(self.meta, self.archetypes, self.state.iter(), self.fetch) }
}
}
Expand Down

0 comments on commit 48fffbe

Please sign in to comment.