Skip to content

Commit

Permalink
Fix some Clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
17cupsofcoffee committed Jan 2, 2024
1 parent 35dacd0 commit e226155
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/graphics/scaling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ impl ScreenScaler {
/// feasible (e.g. 3rd party UI libraries).
pub fn scale_factor(&self) -> f32 {
f32::min(
self.screen_rect.width as f32 / self.inner_width as f32,
self.screen_rect.height as f32 / self.inner_height as f32,
self.screen_rect.width / self.inner_width as f32,
self.screen_rect.height / self.inner_height as f32,
)
}

Expand Down
2 changes: 1 addition & 1 deletion src/platform/device_gl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1555,7 +1555,7 @@ impl Drop for RawRenderbuffer {
unsafe fn cast_slice_assume_aligned<A, B>(a: &[A]) -> &[B] {
slice::from_raw_parts(
a.as_ptr() as *const B,
a.len() * mem::size_of::<A>() / mem::size_of::<B>(),
mem::size_of_val(a) / mem::size_of::<B>(),
)
}

Expand Down

0 comments on commit e226155

Please sign in to comment.