From d2a0c38f68eee039c6086c1304a46b636d7be116 Mon Sep 17 00:00:00 2001 From: glyph Date: Tue, 8 Feb 2022 14:17:46 +0200 Subject: [PATCH] revert connect fn to init --- src/sbot.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/sbot.rs b/src/sbot.rs index 5c640a5..33a27d6 100644 --- a/src/sbot.rs +++ b/src/sbot.rs @@ -39,13 +39,7 @@ 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. - /// Open a TCP stream to the sbot and perform the secret handshake. If - /// successful, create a box stream and split it into a writer and reader. - /// Return RPC handles to the sbot as part of the `struct` output. - pub async fn connect( - ip_port: Option, - net_id: Option, - ) -> Result { + pub async fn init(ip_port: Option, net_id: Option) -> Result { let address = if ip_port.is_none() { "127.0.0.1:8008".to_string() } else { @@ -85,6 +79,10 @@ impl Sbot { /// Private helper function which creates a new connection with sbot, /// but with all variables passed as arguments. + /// + /// Open a TCP stream to the sbot and perform the secret handshake. If + /// successful, create a box stream and split it into a writer and reader. + /// Return RPC handles to the sbot as part of the `struct` output. async fn _get_sbot_connection_helper( address: String, network_id: auth::Key,