Import anyhow::Result instead of fully-qualifying it

This commit is contained in:
Thomas Eizinger 2021-06-09 09:58:00 +10:00
parent 7f2aa59880
commit d01e444c90
No known key found for this signature in database
GPG Key ID: 651AC83A6C6C8B96

View File

@ -1,4 +1,4 @@
use anyhow::anyhow; use anyhow::{anyhow, Result};
use data_encoding::BASE32; use data_encoding::BASE32;
use futures::future::Ready; use futures::future::Ready;
use futures::prelude::*; use futures::prelude::*;
@ -76,7 +76,7 @@ impl Transport for TorTcpConfig {
/// Tor expects an address format of ADDR:PORT. /// Tor expects an address format of ADDR:PORT.
/// This helper function tries to convert the provided multi-address into this /// This helper function tries to convert the provided multi-address into this
/// format. None is returned if an unsupported protocol was provided. /// format. None is returned if an unsupported protocol was provided.
fn to_address_string(multi: Multiaddr) -> anyhow::Result<String> { fn to_address_string(multi: Multiaddr) -> Result<String> {
let mut protocols = multi.iter(); let mut protocols = multi.iter();
let address_string = match protocols.next() { let address_string = match protocols.next() {
// if it is an Onion address, we have all we need and can return // if it is an Onion address, we have all we need and can return