commit 073527e4327ad24c813dcf276f66f59ed909c182
parent 2e0109369761e46f8c60a695a0d6e229b14c4733
Author: triesap <tyson@radroots.org>
Date: Sun, 4 Jan 2026 17:37:12 +0000
nostr: clarify proxy address parse error mapping
- Add explicit AddrParseError type annotation in map_err closure
- Preserve ClientConfigError conversion using error to_string
- Improve type inference readability in proxy_str implementation
- Keep parsing behavior and public API unchanged
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/nostr/src/client.rs b/nostr/src/client.rs
@@ -75,7 +75,9 @@ impl RadrootsNostrClientOptions {
pub fn proxy_str(mut self, addr: &str) -> Result<Self, RadrootsNostrError> {
let parsed: SocketAddr = addr
.parse()
- .map_err(|err| RadrootsNostrError::ClientConfigError(err.to_string()))?;
+ .map_err(|err: std::net::AddrParseError| {
+ RadrootsNostrError::ClientConfigError(err.to_string())
+ })?;
self.proxy = Some(parsed);
Ok(self)
}