Fix clippy lints for Rust 1.90
This commit is contained in:
parent
53e4976915
commit
db5a1f6353
4 changed files with 4 additions and 6 deletions
|
|
@ -11,7 +11,7 @@ pub fn from_rgba(
|
||||||
) -> Result<Icon, Error> {
|
) -> Result<Icon, Error> {
|
||||||
const PIXEL_SIZE: usize = mem::size_of::<u8>() * 4;
|
const PIXEL_SIZE: usize = mem::size_of::<u8>() * 4;
|
||||||
|
|
||||||
if rgba.len() % PIXEL_SIZE != 0 {
|
if !rgba.len().is_multiple_of(PIXEL_SIZE) {
|
||||||
return Err(Error::ByteCountNotDivisibleBy4 {
|
return Err(Error::ByteCountNotDivisibleBy4 {
|
||||||
byte_count: rgba.len(),
|
byte_count: rgba.len(),
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -797,7 +797,7 @@ impl graphics::mesh::Renderer for Renderer {
|
||||||
);
|
);
|
||||||
|
|
||||||
debug_assert!(
|
debug_assert!(
|
||||||
mesh.indices().len() % 3 == 0,
|
mesh.indices().len().is_multiple_of(3),
|
||||||
"Mesh indices length must be a multiple of 3"
|
"Mesh indices length must be a multiple of 3"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -535,8 +535,7 @@ impl Focus {
|
||||||
self.is_window_focused
|
self.is_window_focused
|
||||||
&& ((self.now - self.updated_at).as_millis()
|
&& ((self.now - self.updated_at).as_millis()
|
||||||
/ Self::CURSOR_BLINK_INTERVAL_MILLIS)
|
/ Self::CURSOR_BLINK_INTERVAL_MILLIS)
|
||||||
% 2
|
.is_multiple_of(2)
|
||||||
== 0
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -515,8 +515,7 @@ where
|
||||||
let is_cursor_visible = !is_disabled
|
let is_cursor_visible = !is_disabled
|
||||||
&& ((focus.now - focus.updated_at).as_millis()
|
&& ((focus.now - focus.updated_at).as_millis()
|
||||||
/ CURSOR_BLINK_INTERVAL_MILLIS)
|
/ CURSOR_BLINK_INTERVAL_MILLIS)
|
||||||
% 2
|
.is_multiple_of(2);
|
||||||
== 0;
|
|
||||||
|
|
||||||
let cursor = if is_cursor_visible {
|
let cursor = if is_cursor_visible {
|
||||||
Some((
|
Some((
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue