From 7a109d56385a26871336f2f89487f87c64528ab8 Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Wed, 4 May 2022 23:57:17 -0400 Subject: [PATCH] more cleanup --- parsing/src/parsing.rs | 13 ++++++------- src/consts.rs | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/parsing/src/parsing.rs b/parsing/src/parsing.rs index 4bf17b9..6013ee2 100644 --- a/parsing/src/parsing.rs +++ b/parsing/src/parsing.rs @@ -41,14 +41,13 @@ impl BackingFunction { .filter(|ele| ele != &"x") .collect::>(); - return Err(match var_names_not_x.len() { - 1 => { - format!("Error: invalid variable: {}", var_names_not_x[0]) + return Err(format!( + "Error: invalid variable{}", + match var_names_not_x.len() { + 1 => String::from(": ") + var_names_not_x[0].as_str(), + _ => format!("s: {:?}", var_names_not_x), } - _ => { - format!("Error: invalid variables: {:?}", var_names_not_x) - } - }); + )); } } } diff --git a/src/consts.rs b/src/consts.rs index e96cba4..16fc6fb 100644 --- a/src/consts.rs +++ b/src/consts.rs @@ -92,4 +92,4 @@ lazy_static::lazy_static! { pub fn is_mobile() -> bool { return *IS_MOBILE; } #[cfg(not(target_arch = "wasm32"))] -pub const fn is_mobile() -> bool { return false; } +pub const fn is_mobile() -> bool { false }