commit d021c4a305969ef3b9b95ce32e4afa376bdafa7d
parent a939deae0c9226b846a63ae07723a3e905e05a68
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)
}