From 2af22fc7d29cc3908dfe6184229d24e76288ac0c Mon Sep 17 00:00:00 2001 From: artemis Date: Tue, 17 Dec 2019 21:07:13 -0800 Subject: [PATCH] format the code i modified --- src/main.rs | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/main.rs b/src/main.rs index 51adbea..3a5b688 100644 --- a/src/main.rs +++ b/src/main.rs @@ -72,7 +72,10 @@ fn find_path( } #[post("/move", format = "json", data = "")] -fn make_move(cache_state: State, msg: Json) -> Json { +fn make_move( + cache_state: State, + msg: Json, +) -> Json { let head = msg.you.body[0]; let mut cache = cache_state.lock().expect("wanted cache to be unlockable"); @@ -88,12 +91,14 @@ fn make_move(cache_state: State, msg: Json) -> Json(battlesnake::MoveResponse { move_field: "up".to_string(), }) - }, - Some(next) => Json(battlesnake::MoveResponse{ - move_field: battlesnake::Line{ - start: &head, - end: &next, - }.direction().to_string(), + } + Some(next) => Json(battlesnake::MoveResponse { + move_field: battlesnake::Line { + start: &head, + end: &next, + } + .direction() + .to_string(), }), } }