From 057ca8bf3485b1d3b4d41e186780b9ee4d689f3c Mon Sep 17 00:00:00 2001
From: Guillaume Pasquet <dev@etenil.net>
Date: Mon, 18 Nov 2019 05:57:17 +0000
Subject: Fix formatting

---
 src/main.rs | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

(limited to 'src/main.rs')

diff --git a/src/main.rs b/src/main.rs
index fcab47b..8488a2e 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -7,15 +7,15 @@ mod state;
 mod tiling;
 mod world;
 
+use crossterm::cursor;
+use crossterm::input::{input, InputEvent, KeyEvent};
+use crossterm::screen::{EnterAlternateScreen, LeaveAlternateScreen, RawScreen};
+use crossterm::terminal;
+use crossterm::{execute, Output};
 use entities::{Entity, Player};
 use state::State;
 use std::env;
 use std::io::{stdout, Write};
-use crossterm::{execute, Output};
-use crossterm::cursor;
-use crossterm::screen::{EnterAlternateScreen, LeaveAlternateScreen, RawScreen};
-use crossterm::input::{input, InputEvent, KeyEvent};
-use crossterm::terminal;
 use world::{Dungeon, DOWN, LEFT, RIGHT, UP};
 
 fn get_player_name() -> String {
@@ -30,11 +30,7 @@ fn main() {
 
     let mut state = State::new(
         Player::new(get_player_name(), String::from("Warrior"), 30, 10, 10, 20),
-        Dungeon::new(
-            term_size.0 as usize,
-            (term_size.1 - 2) as usize,
-            5,
-        ),
+        Dungeon::new(term_size.0 as usize, (term_size.1 - 2) as usize, 5),
     );
 
     state.init();
@@ -58,12 +54,14 @@ fn main() {
         if let Some(event) = reader.next() {
             match event {
                 InputEvent::Keyboard(KeyEvent::Char('q')) => break,
-                InputEvent::Keyboard(KeyEvent::Char('?')) => execute!(stdout(), Output("q: quit")).unwrap(),
+                InputEvent::Keyboard(KeyEvent::Char('?')) => {
+                    execute!(stdout(), Output("q: quit")).unwrap()
+                }
                 InputEvent::Keyboard(KeyEvent::Char('j')) => state.player.move_by(DOWN).unwrap(),
                 InputEvent::Keyboard(KeyEvent::Char('k')) => state.player.move_by(UP).unwrap(),
                 InputEvent::Keyboard(KeyEvent::Char('h')) => state.player.move_by(LEFT).unwrap(),
                 InputEvent::Keyboard(KeyEvent::Char('l')) => state.player.move_by(RIGHT).unwrap(),
-                _ => ()
+                _ => (),
             }
         }
         // actors actions (normally attack / interact if on same location as the character)
-- 
cgit v1.2.3