♻️ refactor: remove redundant brackets and indents

main
_ 2021-10-29 11:48:20 -05:00
parent cfc5785995
commit d4847f2239
1 changed files with 84 additions and 94 deletions

View File

@ -329,15 +329,14 @@ impl State {
output output
} }
Look (item_name) => { Look (item_name) => match item_name {
match item_name {
ItemName::Door => { ItemName::Door => {
self.room_1.detected_keypad = true; self.room_1.detected_keypad = true;
just (line_response ("You examine the DOOR. It is firmly locked, and you don't have any lock-picking tools. On the DOOR is an electronic KEYPAD.")) just (line_response ("You examine the DOOR. It is firmly locked, and you don't have any lock-picking tools. On the DOOR is an electronic KEYPAD."))
}, },
ItemName::EmergencyExit => { ItemName::EmergencyExit => just (line_response (
just (line_response ("The EMERGENCY EXIT reads, \"Emergency exit. Push bar to open. Alarm will sound. Door will unlock in 10 seconds.\". The EMERGENCY EXIT is period-accurate for an American Wal-Mart c. 2020 C.E.")) "The EMERGENCY EXIT reads, \"Emergency exit. Push bar to open. Alarm will sound. Door will unlock in 10 seconds.\". The EMERGENCY EXIT is period-accurate for an American Wal-Mart c. 2020 C.E."
}, )),
ItemName::Keypad => { ItemName::Keypad => {
require_detection! (self.room_1.detected_keypad); require_detection! (self.room_1.detected_keypad);
@ -369,13 +368,9 @@ impl State {
self.room_1.detected_note = true; self.room_1.detected_note = true;
just (line_response ("You look at the TABLE. Your instincts tell you that it is period-accurate. Upon the TABLE sits a NOTE.")) just (line_response ("You look at the TABLE. Your instincts tell you that it is period-accurate. Upon the TABLE sits a NOTE."))
}, },
_ => { _ => just (undetected_item ()),
just (undetected_item ())
}, },
} Use (item_name) => match item_name {
},
Use (item_name) => {
match item_name {
ItemName::Door => { ItemName::Door => {
let mut output = vec! [ let mut output = vec! [
line_response ("You can't USE the DOOR, it is locked."), line_response ("You can't USE the DOOR, it is locked."),
@ -388,8 +383,7 @@ impl State {
output output
}, },
ItemName::EmergencyExit => { ItemName::EmergencyExit => vec! [
vec! [
line_response ("You push on the emergency exit. An alarm starts sounding. Your ADVENTURE GAME ENTHUSIAST friend is going to be very mad at you."), line_response ("You push on the emergency exit. An alarm starts sounding. Your ADVENTURE GAME ENTHUSIAST friend is going to be very mad at you."),
Response::Sleep (5000), Response::Sleep (5000),
line_response ("The alarm is still sounding. You are getting embarrassed, but you have committed to this path of action."), line_response ("The alarm is still sounding. You are getting embarrassed, but you have committed to this path of action."),
@ -397,8 +391,7 @@ impl State {
line_response ("The emergency exit unlocks, and you walk out of the game. Bye."), line_response ("The emergency exit unlocks, and you walk out of the game. Bye."),
Response::JokeEnding, Response::JokeEnding,
Response::Quit, Response::Quit,
] ],
},
ItemName::Keypad => { ItemName::Keypad => {
require_detection! (self.room_1.detected_keypad); require_detection! (self.room_1.detected_keypad);
@ -417,13 +410,10 @@ impl State {
just (line_response ("You can't think of any way to USE the NOTE that would be better than LOOKing at it to read it.")) just (line_response ("You can't think of any way to USE the NOTE that would be better than LOOKing at it to read it."))
}, },
ItemName::Table => { ItemName::Table => just (line_response (
just (line_response ("You can't think of any way to USE the TABLE that would be better than LOOKing at it.")) "You can't think of any way to USE the TABLE that would be better than LOOKing at it."
}, )),
_ => { _ => just (undetected_item ()),
just (undetected_item ())
},
}
}, },
} }
} }