replace `to_string` with `into` for brevity

This commit is contained in:
Max Bradbury 2021-04-25 17:47:25 +01:00
parent d53244a884
commit 4bd6286cf0
1 changed files with 3 additions and 3 deletions

View File

@ -247,18 +247,18 @@ pub fn add_room() -> String {
let mut state = STATE.lock().expect("Couldn't lock application state"); let mut state = STATE.lock().expect("Couldn't lock application state");
if state.game.is_none() { if state.game.is_none() {
return "No game data loaded".to_string(); return "No game data loaded".into();
} }
match &state.palette { match &state.palette {
SelectedPalette::None => { return "No palette selected".to_string(); }, SelectedPalette::None => { return "No palette selected".into(); },
_ => {} _ => {}
}; };
let mut game = state.game.clone().unwrap(); let mut game = state.game.clone().unwrap();
if state.image.is_none() { if state.image.is_none() {
return "No image loaded".to_string(); return "No image loaded".into();
} }
let palette_id = Some(match &state.palette { let palette_id = Some(match &state.palette {