From 973b9b2c156510bfa5ac1a3e4038bc01589c464e Mon Sep 17 00:00:00 2001 From: kdeng00 Date: Thu, 23 Oct 2025 21:04:26 -0400 Subject: [PATCH] tsk-80: Formatting code --- src/models/api.rs | 1 - src/models/flags.rs | 1 - src/models/icarus_action.rs | 1 - src/utilities/string.rs | 20 ++++++-------------- 4 files changed, 6 insertions(+), 17 deletions(-) diff --git a/src/models/api.rs b/src/models/api.rs index 9fea79f..ff88f16 100644 --- a/src/models/api.rs +++ b/src/models/api.rs @@ -1,6 +1,5 @@ use std::default::Default; - #[derive(Clone, Debug, Default)] pub struct Api { pub url: String, diff --git a/src/models/flags.rs b/src/models/flags.rs index b5476ef..7aa0d0b 100644 --- a/src/models/flags.rs +++ b/src/models/flags.rs @@ -1,6 +1,5 @@ use std::default::Default; - #[derive(Clone, Debug, Default)] pub struct Flags { pub flag: String, diff --git a/src/models/icarus_action.rs b/src/models/icarus_action.rs index a2b212f..f1897ba 100644 --- a/src/models/icarus_action.rs +++ b/src/models/icarus_action.rs @@ -2,7 +2,6 @@ use std::default::Default; use crate::models; - #[derive(Clone, Debug, Default)] pub struct IcarusAction { pub action: String, diff --git a/src/utilities/string.rs b/src/utilities/string.rs index 5b18625..e58ec73 100644 --- a/src/utilities/string.rs +++ b/src/utilities/string.rs @@ -2,19 +2,11 @@ pub fn o_to_string(val: &std::ffi::OsString) -> Result Ok(value), Err(err) => match err.into_string() { - Ok(res) => { - Err(std::io::Error::other(res.to_string())) - } - Err(err) => { - match err.to_str() { - Some(err) => { - Err(std::io::Error::other(err)) - } - None => { - Err(std::io::Error::other("Undefined error")) - } - } - } - } + Ok(res) => Err(std::io::Error::other(res.to_string())), + Err(err) => match err.to_str() { + Some(err) => Err(std::io::Error::other(err)), + None => Err(std::io::Error::other("Undefined error")), + }, + }, } }