From 227c9bb2462a318196532b2b7d946a3135c89ed0 Mon Sep 17 00:00:00 2001 From: yggverse Date: Sat, 23 Nov 2024 18:11:44 +0200 Subject: [PATCH] apply clippy optimizations --- src/profile/bookmark/memory/error.rs | 2 +- src/profile/identity/error.rs | 2 +- src/profile/identity/gemini/auth/error.rs | 2 +- src/profile/identity/gemini/auth/memory/error.rs | 4 ++-- src/profile/identity/gemini/error.rs | 4 ++-- src/profile/identity/gemini/memory/error.rs | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/profile/bookmark/memory/error.rs b/src/profile/bookmark/memory/error.rs index 8ade67e5..b048c121 100644 --- a/src/profile/bookmark/memory/error.rs +++ b/src/profile/bookmark/memory/error.rs @@ -10,7 +10,7 @@ impl Error { Self::Overwrite(key) => { format!("Overwrite attempt for existing record `{key}`") } - Self::Unexpected => format!("Unexpected error"), + Self::Unexpected => "Unexpected error".to_string(), } } } diff --git a/src/profile/identity/error.rs b/src/profile/identity/error.rs index 45199566..feb7a678 100644 --- a/src/profile/identity/error.rs +++ b/src/profile/identity/error.rs @@ -8,7 +8,7 @@ impl Error { pub fn to_string(&self) -> String { match self { Self::Database(reason) => { - format!("Database error: {}", reason.to_string()) + format!("Database error: {}", reason) } Self::Gemini(reason) => { format!("Could not init Gemini identity: {}", reason.to_string()) diff --git a/src/profile/identity/gemini/auth/error.rs b/src/profile/identity/gemini/auth/error.rs index 6b1c83ba..5cbee27e 100644 --- a/src/profile/identity/gemini/auth/error.rs +++ b/src/profile/identity/gemini/auth/error.rs @@ -7,7 +7,7 @@ pub enum Error { impl Error { pub fn to_string(&self) -> String { match self { - Self::Database(reason) => format!("Database error: {}", reason.to_string()), + Self::Database(reason) => format!("Database error: {}", reason), Self::Memory(reason) => format!("Memory error: {}", reason.to_string()), } } diff --git a/src/profile/identity/gemini/auth/memory/error.rs b/src/profile/identity/gemini/auth/memory/error.rs index 895e86cc..e37ce1a7 100644 --- a/src/profile/identity/gemini/auth/memory/error.rs +++ b/src/profile/identity/gemini/auth/memory/error.rs @@ -8,11 +8,11 @@ pub enum Error { impl Error { pub fn to_string(&self) -> String { match self { - Self::Clear => format!("Could not cleanup memory index"), + Self::Clear => "Could not cleanup memory index".to_string(), Self::Overwrite(key) => { format!("Overwrite attempt for existing record `{key}`") } - Self::Unexpected => format!("Unexpected error"), + Self::Unexpected => "Unexpected error".to_string(), } } } diff --git a/src/profile/identity/gemini/error.rs b/src/profile/identity/gemini/error.rs index d06452a8..6519439c 100644 --- a/src/profile/identity/gemini/error.rs +++ b/src/profile/identity/gemini/error.rs @@ -11,10 +11,10 @@ impl Error { match self { Self::Auth(reason) => format!("Could not create auth: {}", reason.to_string()), Self::Certificate(reason) => { - format!("Could not create certificate: {}", reason.to_string()) + format!("Could not create certificate: {}", reason) } Self::Database(reason) => { - format!("Database error: {}", reason.to_string()) + format!("Database error: {}", reason) } Self::Memory(reason) => format!("Memory error: {}", reason.to_string()), } diff --git a/src/profile/identity/gemini/memory/error.rs b/src/profile/identity/gemini/memory/error.rs index 3592df71..317dfec5 100644 --- a/src/profile/identity/gemini/memory/error.rs +++ b/src/profile/identity/gemini/memory/error.rs @@ -9,14 +9,14 @@ pub enum Error { impl Error { pub fn to_string(&self) -> String { match self { - Self::Clear => format!("Could not cleanup memory index"), + Self::Clear => "Could not cleanup memory index".to_string(), Self::NotFound(key) => { format!("Record `{key}` not found in memory index") } Self::Overwrite(key) => { format!("Overwrite attempt for existing record `{key}`") } - Self::Unexpected => format!("Unexpected error"), + Self::Unexpected => "Unexpected error".to_string(), } } }