From 1e0c129dcadec0740e2da40d8a8a129830d837cc Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 18 Apr 2020 17:08:16 +0000 Subject: [PATCH] Format Rust code using rustfmt --- src/bin/smiley.rs | 4 +--- src/game.rs | 44 +++++++++++++++++++------------------------- 2 files changed, 20 insertions(+), 28 deletions(-) diff --git a/src/bin/smiley.rs b/src/bin/smiley.rs index 1bca3bc..b1d60c4 100644 --- a/src/bin/smiley.rs +++ b/src/bin/smiley.rs @@ -12,9 +12,7 @@ fn main() { .nth(2) .expect("No output path specified. Usage: `smiley infile outfile`"); - let mut game = Game::from( - fs::read_to_string(input_file).unwrap() - ).unwrap(); + let mut game = Game::from(fs::read_to_string(input_file).unwrap()).unwrap(); game.avatar.animation_frames = vec![Image { pixels: vec![ diff --git a/src/game.rs b/src/game.rs index b052c11..f5a50a1 100644 --- a/src/game.rs +++ b/src/game.rs @@ -143,25 +143,23 @@ impl Game { assert!(avatar.is_some()); let avatar = avatar.unwrap(); - Ok ( - Game { - name, - version, - room_format, - font, - custom_font, - text_direction, - palettes, - rooms, - tiles, - avatar, - sprites, - items, - dialogues, - endings, - variables, - } - ) + Ok(Game { + name, + version, + room_format, + font, + custom_font, + text_direction, + palettes, + rooms, + tiles, + avatar, + sprites, + items, + dialogues, + endings, + variables, + }) } } @@ -304,9 +302,7 @@ impl Game { #[test] fn test_game_from_string() { - let output = Game::from( - include_str!["test-resources/default.bitsy"].to_string() - ).unwrap(); + let output = Game::from(include_str!["test-resources/default.bitsy"].to_string()).unwrap(); let expected = crate::mock::game_default(); @@ -429,9 +425,7 @@ fn test_bitsy_omnibus() { #[test] fn test_arabic() { - let game = Game::from( - include_str!("test-resources/arabic.bitsy").to_string() - ).unwrap(); + let game = Game::from(include_str!("test-resources/arabic.bitsy").to_string()).unwrap(); assert_eq!(game.font, Font::Arabic); assert_eq!(game.text_direction, TextDirection::RightToLeft);