diff --git a/crates/nostr-sdk/src/relay/mod.rs b/crates/nostr-sdk/src/relay/mod.rs index 62ee02b8f..77938568f 100644 --- a/crates/nostr-sdk/src/relay/mod.rs +++ b/crates/nostr-sdk/src/relay/mod.rs @@ -197,7 +197,7 @@ where match s.as_str() { "default" => Self::Default, "pool" => Self::Pool, - c => Self::Custom(c.to_string()), + _ => Self::Custom(s), } } } diff --git a/crates/nostr/src/event/tag.rs b/crates/nostr/src/event/tag.rs index 81420b0df..964c058fd 100644 --- a/crates/nostr/src/event/tag.rs +++ b/crates/nostr/src/event/tag.rs @@ -160,7 +160,7 @@ where match s.as_str() { "root" => Self::Root, "reply" => Self::Reply, - m => Self::Custom(m.to_string()), + _ => Self::Custom(s), } } } @@ -232,7 +232,7 @@ where "planned" => Self::Planned, "live" => Self::Live, "ended" => Self::Ended, - s => Self::Custom(s.to_string()), + _ => Self::Custom(s), } } } @@ -545,8 +545,8 @@ where S: Into, { fn from(s: S) -> Self { - let s: String = s.into(); - match s.as_str() { + let tag: String = s.into(); + match tag.as_str() { "p" => Self::P, "e" => Self::E, "r" => Self::R, @@ -595,7 +595,7 @@ where "anon" => Self::Anon, "proxy" => Self::Proxy, "emoji" => Self::Emoji, - tag => Self::Custom(tag.to_string()), + _ => Self::Custom(tag), } } } diff --git a/crates/nostr/src/message/relay/mod.rs b/crates/nostr/src/message/relay/mod.rs index d41697cf2..2509d28c3 100644 --- a/crates/nostr/src/message/relay/mod.rs +++ b/crates/nostr/src/message/relay/mod.rs @@ -57,7 +57,7 @@ where "CLOSED" => Self::Closed, "FILTER_NOT_FOUND" => Self::FilterNotFound, "FILTER_INVALID" => Self::FilterInvalid, - o => Self::Other(o.to_string()), + _ => Self::Other(code), } } } diff --git a/crates/nostr/src/nips/nip48.rs b/crates/nostr/src/nips/nip48.rs index e64c670a1..5b718600b 100644 --- a/crates/nostr/src/nips/nip48.rs +++ b/crates/nostr/src/nips/nip48.rs @@ -5,7 +5,7 @@ //! //! -use alloc::string::{String, ToString}; +use alloc::string::String; use core::fmt; /// NIP48 Proxy Protocol @@ -46,7 +46,7 @@ where "atproto" => Self::ATProto, "rss" => Self::Rss, "web" => Self::Web, - s => Self::Custom(s.to_string()), + _ => Self::Custom(s), } } }