Format Rust code using rustfmt
This commit is contained in:
parent
f550c3696f
commit
1e0c129dca
|
@ -12,9 +12,7 @@ fn main() {
|
||||||
.nth(2)
|
.nth(2)
|
||||||
.expect("No output path specified. Usage: `smiley infile outfile`");
|
.expect("No output path specified. Usage: `smiley infile outfile`");
|
||||||
|
|
||||||
let mut game = Game::from(
|
let mut game = Game::from(fs::read_to_string(input_file).unwrap()).unwrap();
|
||||||
fs::read_to_string(input_file).unwrap()
|
|
||||||
).unwrap();
|
|
||||||
|
|
||||||
game.avatar.animation_frames = vec![Image {
|
game.avatar.animation_frames = vec![Image {
|
||||||
pixels: vec![
|
pixels: vec![
|
||||||
|
|
14
src/game.rs
14
src/game.rs
|
@ -143,8 +143,7 @@ impl Game {
|
||||||
assert!(avatar.is_some());
|
assert!(avatar.is_some());
|
||||||
let avatar = avatar.unwrap();
|
let avatar = avatar.unwrap();
|
||||||
|
|
||||||
Ok (
|
Ok(Game {
|
||||||
Game {
|
|
||||||
name,
|
name,
|
||||||
version,
|
version,
|
||||||
room_format,
|
room_format,
|
||||||
|
@ -160,8 +159,7 @@ impl Game {
|
||||||
dialogues,
|
dialogues,
|
||||||
endings,
|
endings,
|
||||||
variables,
|
variables,
|
||||||
}
|
})
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -304,9 +302,7 @@ impl Game {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_game_from_string() {
|
fn test_game_from_string() {
|
||||||
let output = Game::from(
|
let output = Game::from(include_str!["test-resources/default.bitsy"].to_string()).unwrap();
|
||||||
include_str!["test-resources/default.bitsy"].to_string()
|
|
||||||
).unwrap();
|
|
||||||
|
|
||||||
let expected = crate::mock::game_default();
|
let expected = crate::mock::game_default();
|
||||||
|
|
||||||
|
@ -429,9 +425,7 @@ fn test_bitsy_omnibus() {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_arabic() {
|
fn test_arabic() {
|
||||||
let game = Game::from(
|
let game = Game::from(include_str!("test-resources/arabic.bitsy").to_string()).unwrap();
|
||||||
include_str!("test-resources/arabic.bitsy").to_string()
|
|
||||||
).unwrap();
|
|
||||||
|
|
||||||
assert_eq!(game.font, Font::Arabic);
|
assert_eq!(game.font, Font::Arabic);
|
||||||
assert_eq!(game.text_direction, TextDirection::RightToLeft);
|
assert_eq!(game.text_direction, TextDirection::RightToLeft);
|
||||||
|
|
Loading…
Reference in New Issue