diff --git a/src/graphics/scaling.rs b/src/graphics/scaling.rs
index aea4b19..92de0c0 100644
--- a/src/graphics/scaling.rs
+++ b/src/graphics/scaling.rs
@@ -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,
)
}
diff --git a/src/platform/device_gl.rs b/src/platform/device_gl.rs
index ce66bf9..c145ec8 100644
--- a/src/platform/device_gl.rs
+++ b/src/platform/device_gl.rs
@@ -1555,7 +1555,7 @@ impl Drop for RawRenderbuffer {
unsafe fn cast_slice_assume_aligned(a: &[A]) -> &[B] {
slice::from_raw_parts(
a.as_ptr() as *const B,
- a.len() * mem::size_of::() / mem::size_of::(),
+ mem::size_of_val(a) / mem::size_of::(),
)
}