diff --git a/src/sbot.rs b/src/sbot.rs index 63bdeb4..4e28967 100644 --- a/src/sbot.rs +++ b/src/sbot.rs @@ -53,15 +53,19 @@ impl Sbot { /// Initiate a connection with an sbot instance. Define the IP address, /// port and network key for the sbot, then retrieve the public key, /// private key (secret) and identity from the `.ssb-go/secret` file. - pub async fn init( + pub async fn init( keystore: Keystore, - ip_port: Option, - net_id: Option, - ) -> Result { + ip_port: Option, + net_id: Option, + ) -> Result + where + S: Into, + T: Into, + { let mut address = if ip_port.is_none() { "127.0.0.1:8008".to_string() } else { - ip_port.unwrap() + ip_port.unwrap().into() }; if address.starts_with(':') { @@ -71,7 +75,7 @@ impl Sbot { let network_id = if net_id.is_none() { discovery::ssb_net_id() } else { - auth::Key::from_slice(&hex::decode(net_id.unwrap()).unwrap()).unwrap() + auth::Key::from_slice(&hex::decode(net_id.unwrap().into()).unwrap()).unwrap() }; let OwnedIdentity { pk, sk, id } = match keystore {