message: Try another way to reduce duplication
diff: use std::convert::TryFrom;
  use std::io;
  +use winit::dpi::PhysicalSize;
  +
  use crate::error::{GameError, GameResult};
  /// Possible fullscreen modes.
  @@ -196,19 +198,14 @@ impl WindowMode {
  // Use logical_size if set, else convert width/height to PhysicalSize
  pub(crate) fn actual_size(&self) -> GameResult<winit::dpi::Size> {
  - if let Some(logical_size) = self.logical_size {
  - if logical_size.width >= 1.0 && logical_size.height >= 1.0 {
  - Ok(logical_size.into())
  + let actual_size: winit::dpi::Size = if let Some(logical_size) = self.logical_size {
  + logical_size.into()
  } else {
  - Err(GameError::WindowError(format!(
  - "window width and height need to be at least 1; actual values: {}, {}",
  - logical_size.width, logical_size.height
  - )))
  - }
  - } else {
  - let physical_size = winit::dpi::PhysicalSize::<f64>::from((self.width, self.height));
  + winit::dpi::PhysicalSize::<f64>::from((self.width, self.height)).into()
  + };
  + let physical_size: PhysicalSize<f64> = actual_size.to_physical(1.0);
  if physical_size.width >= 1.0 && physical_size.height >= 1.0 {
  - Ok(physical_size.into())
  + Ok(actual_size)
  } else {
  Err(GameError::WindowError(format!(
  "window width and height need to be at least 1; actual values: {}, {}",
  @@ -217,7 +214,6 @@ impl WindowMode {
  }
  }
  }
  -}
  /// A builder structure containing window settings
  /// that must be set at init time and cannot be changed afterwards.
  