diff options
Diffstat (limited to 'atuin-client/src')
-rw-r--r-- | atuin-client/src/api_client.rs | 2 | ||||
-rw-r--r-- | atuin-client/src/encryption.rs | 4 | ||||
-rw-r--r-- | atuin-client/src/lib.rs | 8 |
3 files changed, 9 insertions, 5 deletions
diff --git a/atuin-client/src/api_client.rs b/atuin-client/src/api_client.rs index 171012acd..d907265b0 100644 --- a/atuin-client/src/api_client.rs +++ b/atuin-client/src/api_client.rs @@ -38,7 +38,7 @@ pub async fn register( map.insert("password", password); let url = format!("{}/user/{}", address, username); - let resp = reqwest::blocking::get(url)?; + let resp = reqwest::get(url).await?; if resp.status().is_success() { bail!("username already in use"); diff --git a/atuin-client/src/encryption.rs b/atuin-client/src/encryption.rs index 4746c23ed..f805cbd56 100644 --- a/atuin-client/src/encryption.rs +++ b/atuin-client/src/encryption.rs @@ -77,7 +77,7 @@ pub fn encode_key(key: secretbox::Key) -> Result<String> { pub fn decode_key(key: String) -> Result<secretbox::Key> { let buf = base64::decode(key).wrap_err("encryption key is not a valid base64 encoding")?; - let buf: secretbox::Key = rmp_serde::from_read_ref(&buf) + let buf: secretbox::Key = rmp_serde::from_slice(&buf) .wrap_err("encryption key is not a valid message pack encoding")?; Ok(buf) @@ -98,7 +98,7 @@ pub fn decrypt(encrypted_history: &EncryptedHistory, key: &secretbox::Key) -> Re let plaintext = secretbox::open(&encrypted_history.ciphertext, &encrypted_history.nonce, key) .map_err(|_| eyre!("failed to open secretbox - invalid key?"))?; - let history = rmp_serde::from_read_ref(&plaintext)?; + let history = rmp_serde::from_slice(&plaintext)?; Ok(history) } diff --git a/atuin-client/src/lib.rs b/atuin-client/src/lib.rs index 98e2f3aeb..497c5e749 100644 --- a/atuin-client/src/lib.rs +++ b/atuin-client/src/lib.rs @@ -3,11 +3,15 @@ #[macro_use] extern crate log; +#[cfg(feature = "sync")] pub mod api_client; -pub mod database; +#[cfg(feature = "sync")] pub mod encryption; +#[cfg(feature = "sync")] +pub mod sync; + +pub mod database; pub mod history; pub mod import; pub mod ordering; pub mod settings; -pub mod sync; |