Skip to content

Commit

Permalink
make clippy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
ellie committed May 6, 2024
1 parent 6addbb5 commit 326cd99
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 22 deletions.
4 changes: 2 additions & 2 deletions crates/atuin-daemon/src/server/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ pub async fn worker(settings: Settings, store: SqliteStore) -> Result<()> {

let new_interval = ticker.period().as_secs_f64() * rng.gen_range(2.0..2.2);

// Don't backoff by more than 2hrs
if new_interval > 2.0 * 60.0 * 60.0 {
// Don't backoff by more than 30 mins
if new_interval > 60.0 * 30.0 {
continue;
}

Expand Down
6 changes: 1 addition & 5 deletions crates/atuin/src/command/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@ use clap::Subcommand;
use eyre::{Result, WrapErr};

use atuin_client::{database::Sqlite, record::sqlite_store::SqliteStore, settings::Settings};
use tracing_subscriber::{
filter::{EnvFilter, LevelFilter},
fmt,
prelude::*,
};
use tracing_subscriber::{filter::EnvFilter, fmt, prelude::*};

#[cfg(feature = "sync")]
mod sync;
Expand Down
7 changes: 2 additions & 5 deletions crates/atuin/src/command/client/daemon.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
use eyre::{Result, WrapErr};
use eyre::Result;

use atuin_client::{
database::Sqlite, encryption, history::store::HistoryStore, record::sqlite_store::SqliteStore,
settings::Settings,
};
use atuin_client::{database::Sqlite, record::sqlite_store::SqliteStore, settings::Settings};
use atuin_daemon::server::listen;

pub async fn run(settings: Settings, store: SqliteStore, history_db: Sqlite) -> Result<()> {
Expand Down
18 changes: 8 additions & 10 deletions crates/atuin/src/command/client/history.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ use atuin_client::{
use atuin_client::{record, sync};

use log::{debug, warn};
use rustix::path::Arg;
use time::{macros::format_description, OffsetDateTime};

use super::search::format_duration_into;
Expand Down Expand Up @@ -316,15 +315,15 @@ impl Cmd {
}

if settings.daemon.enabled {
let mut client =
let resp =
atuin_daemon::client::HistoryClient::new(settings.daemon.socket_path.clone())
.await?
.start_history(h)
.await?;

let resp = client.start_history(h).await?;

// print the ID
// we use this as the key for calling end
println!("{}", resp);
println!("{resp}");

return Ok(());
}
Expand All @@ -351,11 +350,10 @@ impl Cmd {
// We will need to keep the old code around for a while.
// At the very least, while this is opt-in
if settings.daemon.enabled {
let mut client =
atuin_daemon::client::HistoryClient::new(settings.daemon.socket_path.clone())
.await?;

client.end_history(id.to_string(), duration, exit).await?;
atuin_daemon::client::HistoryClient::new(settings.daemon.socket_path.clone())
.await?
.end_history(id.to_string(), duration, exit)
.await?;

return Ok(());
}
Expand Down

0 comments on commit 326cd99

Please sign in to comment.