aboutsummaryrefslogtreecommitdiffstats
path: root/atuin-client/src
diff options
context:
space:
mode:
Diffstat (limited to 'atuin-client/src')
-rw-r--r--atuin-client/src/database.rs8
-rw-r--r--atuin-client/src/sync.rs6
2 files changed, 7 insertions, 7 deletions
diff --git a/atuin-client/src/database.rs b/atuin-client/src/database.rs
index c75a32ce..a7be9436 100644
--- a/atuin-client/src/database.rs
+++ b/atuin-client/src/database.rs
@@ -70,8 +70,8 @@ pub fn current_context() -> Context {
#[async_trait]
pub trait Database: Send + Sync + 'static {
- async fn save(&mut self, h: &History) -> Result<()>;
- async fn save_bulk(&mut self, h: &[History]) -> Result<()>;
+ async fn save(&self, h: &History) -> Result<()>;
+ async fn save_bulk(&self, h: &[History]) -> Result<()>;
async fn load(&self, id: &str) -> Result<Option<History>>;
async fn list(
@@ -193,7 +193,7 @@ impl Sqlite {
#[async_trait]
impl Database for Sqlite {
- async fn save(&mut self, h: &History) -> Result<()> {
+ async fn save(&self, h: &History) -> Result<()> {
debug!("saving history to sqlite");
let mut tx = self.pool.begin().await?;
Self::save_raw(&mut tx, h).await?;
@@ -202,7 +202,7 @@ impl Database for Sqlite {
Ok(())
}
- async fn save_bulk(&mut self, h: &[History]) -> Result<()> {
+ async fn save_bulk(&self, h: &[History]) -> Result<()> {
debug!("saving history to sqlite");
let mut tx = self.pool.begin().await?;
diff --git a/atuin-client/src/sync.rs b/atuin-client/src/sync.rs
index c2fc75f9..5f612c71 100644
--- a/atuin-client/src/sync.rs
+++ b/atuin-client/src/sync.rs
@@ -37,7 +37,7 @@ async fn sync_download(
key: &Key,
force: bool,
client: &api_client::Client<'_>,
- db: &mut (impl Database + Send),
+ db: &(impl Database + Send),
) -> Result<(i64, i64)> {
debug!("starting sync download");
@@ -127,7 +127,7 @@ async fn sync_upload(
key: &Key,
_force: bool,
client: &api_client::Client<'_>,
- db: &mut (impl Database + Send),
+ db: &(impl Database + Send),
) -> Result<()> {
debug!("starting sync upload");
@@ -188,7 +188,7 @@ async fn sync_upload(
Ok(())
}
-pub async fn sync(settings: &Settings, force: bool, db: &mut (impl Database + Send)) -> Result<()> {
+pub async fn sync(settings: &Settings, force: bool, db: &(impl Database + Send)) -> Result<()> {
let client = api_client::Client::new(
&settings.sync_address,
&settings.session_token,