summaryrefslogtreecommitdiffstats
path: root/atuin-client/src
diff options
context:
space:
mode:
authorConrad Ludgate <conrad.ludgate@truelayer.com>2022-04-22 21:14:23 +0100
committerGitHub <noreply@github.com>2022-04-22 20:14:23 +0000
commit7436e4ff651b64d4019a59d04c30c414ae220403 (patch)
tree3d5e35df1bce075ae04be63d76f9edc8cc17c6cb /atuin-client/src
parent508d4f476157384b0d454bee3dd6e9256560561b (diff)
feature-flags (#328)
* use feature flags * fmt * fix features * update ci * fmt Co-authored-by: Ellie Huxtable <ellie@elliehuxtable.com>
Diffstat (limited to 'atuin-client/src')
-rw-r--r--atuin-client/src/api_client.rs2
-rw-r--r--atuin-client/src/encryption.rs4
-rw-r--r--atuin-client/src/lib.rs8
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;