diff --git a/src/keystore/gosbot.rs b/src/keystore/gosbot.rs index 2b0b3dc..d29e9b8 100644 --- a/src/keystore/gosbot.rs +++ b/src/keystore/gosbot.rs @@ -7,18 +7,12 @@ use async_std::{ prelude::*, }; -use std::string::ToString; - use super::{ error::{Error, Result}, - JsonSSBSecret, OwnedIdentity, CURVE_ED25519, + util, JsonSSBSecret, OwnedIdentity, CURVE_ED25519, }; use crate::crypto::{ToSodiumObject, ToSsbId}; -fn to_io_error(err: T) -> async_std::io::Error { - async_std::io::Error::new(std::io::ErrorKind::Other, err.to_string()) -} - /// Return an `OwnedIdentity` from the local go-sbot secret file. pub async fn from_gosbot_local() -> Result { let home_dir = dirs::home_dir().ok_or(Error::HomeNotFound)?; @@ -34,7 +28,7 @@ pub async fn read_gosbot_config(reader: &mut R) -> Result(err: T) -> async_std::io::Error { - async_std::io::Error::new(std::io::ErrorKind::Other, err.to_string()) -} - pub async fn from_patchwork_local() -> Result { let home_dir = dirs::home_dir().ok_or(Error::HomeNotFound)?; let local_key_file = format!("{}/.ssb/secret", home_dir.to_string_lossy()); @@ -34,7 +28,7 @@ pub async fn read_patchwork_config(reader: &mut R) -> Result(err: T) -> async_std::io::Error { + async_std::io::Error::new(std::io::ErrorKind::Other, err.to_string()) +}