Inline redundant function

This commit is contained in:
Hanno Braun 2025-03-25 21:00:53 +01:00
parent 000a9a52df
commit 5af1b5ab22
2 changed files with 4 additions and 11 deletions

View File

@ -177,7 +177,10 @@ impl ViewerWindow {
/// Draw the graphics
pub fn draw(&mut self) {
let size_is_valid = self.window.size().is_valid();
let size_is_valid = {
let size = self.window.size();
size.width > 0 && size.height > 0
};
if !size_is_valid {
return;
}

View File

@ -38,13 +38,3 @@ pub struct WindowSize {
/// The height of the screen
pub height: u32,
}
impl WindowSize {
/// # Indicate whether the screen size is valid
///
/// A screen size is valid, if neither of its dimensions is zero. But it can
/// be reported as zero by spurious screen resize events.
pub fn is_valid(&self) -> bool {
self.width > 0 && self.height > 0
}
}