Skip to content

Commit

Permalink
Use "format!()" instead of "format_args!().to_string()"
Browse files Browse the repository at this point in the history
  • Loading branch information
JDDev0 committed Nov 27, 2024
1 parent 8c1f51d commit ce631a6
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/game.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,13 +259,11 @@ impl <'a> Game<'a> {
pub fn new(console: &'a Console) -> Result<Self, Box<dyn Error>> {
let (width, height) = console.get_console_size();
if width < Self::CONSOLE_MIN_WIDTH || height < Self::CONSOLE_MIN_HEIGHT {
return Err(Box::new(GameError::new(
format_args!(
"Console is to small (Min: {} x {})!",
Self::CONSOLE_MIN_WIDTH,
Self::CONSOLE_MIN_HEIGHT
).to_string())
));
return Err(Box::new(GameError::new(format!(
"Console is to small (Min: {} x {})!",
Self::CONSOLE_MIN_WIDTH,
Self::CONSOLE_MIN_HEIGHT
))));
}

let screens = HashMap::from_iter([
Expand Down

0 comments on commit ce631a6

Please sign in to comment.