code clean-up: @discardableResult, unused params, simplify getting specific relays from pool

Closes: #635
This commit is contained in:
Bryan Montz
2023-02-17 06:58:53 -06:00
committed by William Casarin
parent a1a89dc98e
commit 193e922c9c
11 changed files with 21 additions and 36 deletions

View File

@@ -95,20 +95,20 @@ struct SearchResultsView: View {
return
}
if let _ = hex_decode(new), new.count == 64 {
if hex_decode(new) != nil, new.count == 64 {
self.result = .hex(new)
return
}
if new.starts(with: "npub") {
if let _ = try? bech32_decode(new) {
if (try? bech32_decode(new)) != nil {
self.result = .profile(new)
return
}
}
if new.starts(with: "note") {
if let _ = try? bech32_decode(new) {
if (try? bech32_decode(new)) != nil {
self.result = .note(new)
return
}