Skip to content

Commit

Permalink
Fix unnecessary-qualification in Rust beta
Browse files Browse the repository at this point in the history
```
error: unnecessary qualification
  --> x11rb-protocol/src/wrapper.rs:44:35
   |
44 |         let size = self.0.len() / core::mem::size_of::<T>();
   |                                   ^^^^^^^^^^^^^^^^^^^^^^^
   |
note: the lint level is defined here
  --> x11rb-protocol/src/lib.rs:49:5
   |
49 |     unused_qualifications,
   |     ^^^^^^^^^^^^^^^^^^^^^
help: remove the unnecessary path segments
   |
44 -         let size = self.0.len() / core::mem::size_of::<T>();
44 +         let size = self.0.len() / size_of::<T>();
   |
```

Signed-off-by: Uli Schlachter <psychon@znc.in>
  • Loading branch information
psychon committed Jun 23, 2024
1 parent c55337f commit f921b02
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion x11rb-protocol/src/wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ where
}

fn size_hint(&self) -> (usize, Option<usize>) {
let size = self.0.len() / core::mem::size_of::<T>();
use core::mem::size_of;
let size = self.0.len() / size_of::<T>();
(size, Some(size))
}
}
Expand Down

0 comments on commit f921b02

Please sign in to comment.