From 4bd6286cf0f9c9f801e49367498eca871bd0386b Mon Sep 17 00:00:00 2001 From: Max Bradbury Date: Sun, 25 Apr 2021 17:47:25 +0100 Subject: [PATCH] replace `to_string` with `into` for brevity --- src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 5793664..65320e6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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 {