replace `to_string` with `into` for brevity
This commit is contained in:
parent
d53244a884
commit
4bd6286cf0
|
@ -247,18 +247,18 @@ pub fn add_room() -> String {
|
|||
let mut state = STATE.lock().expect("Couldn't lock application state");
|
||||
|
||||
if state.game.is_none() {
|
||||
return "No game data loaded".to_string();
|
||||
return "No game data loaded".into();
|
||||
}
|
||||
|
||||
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();
|
||||
|
||||
if state.image.is_none() {
|
||||
return "No image loaded".to_string();
|
||||
return "No image loaded".into();
|
||||
}
|
||||
|
||||
let palette_id = Some(match &state.palette {
|
||||
|
|
Loading…
Reference in New Issue