From 4930f050c56660c245e5976979babb66aea7bfd5 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Mon, 20 Jul 2026 23:44:15 +0200 Subject: chore: Last big refactoring --- crates/daemon/src/aclient/history/mod.rs | 36 -------------------------------- 1 file changed, 36 deletions(-) (limited to 'crates/daemon/src/aclient/history/mod.rs') diff --git a/crates/daemon/src/aclient/history/mod.rs b/crates/daemon/src/aclient/history/mod.rs index f9afa5e9..ae7654a6 100644 --- a/crates/daemon/src/aclient/history/mod.rs +++ b/crates/daemon/src/aclient/history/mod.rs @@ -1,4 +1,3 @@ -use regex::RegexSet; use rmp::decode::DecodeStringError; use rmp::decode::ValueReadError; use rmp::{Marker, decode::Bytes}; @@ -18,28 +17,6 @@ const HISTORY_RECORD_VERSION_V0: u16 = 0; const HISTORY_RECORD_VERSION_V1: u16 = 1; const HISTORY_VERSION: &str = HISTORY_VERSION_V1; const HISTORY_TAG: &str = "history"; -const HISTORY_AUTHOR_ENV: &str = "ATUIN_HISTORY_AUTHOR"; -const HISTORY_INTENT_ENV: &str = "ATUIN_HISTORY_INTENT"; - -#[derive(Debug, Clone, PartialEq, Eq, sqlx::FromRow)] -pub(crate) struct HistoryStats { - /// The command that was ran after this one in the session - pub(crate) next: Option, - - /// The command that was ran before this one in the session - pub(crate) previous: Option, - - /// How many times has this command been ran? - pub(crate) total: u64, - - pub(crate) average_duration: u64, - - pub(crate) exits: Vec<(i64, i64)>, - - pub(crate) day_of_week: Vec<(String, i64)>, - - pub(crate) duration_over_time: Vec<(String, i64)>, -} trait HistoryExt: Sized { fn serialize(&self) -> Result; @@ -47,7 +24,6 @@ trait HistoryExt: Sized { fn deserialize_v0(bytes: &[u8]) -> Result; fn deserialize_v1(bytes: &[u8]) -> Result; fn deserialize(bytes: &[u8], version: &str) -> Result; - fn success(&self) -> bool; } impl HistoryExt for History { @@ -248,18 +224,6 @@ impl HistoryExt for History { _ => bail!("unknown version {version:?}"), } } - - #[expect(unused)] - fn success(&self) -> bool { - self.exit == 0 || self.duration == -1 - } -} - -#[derive(Debug, Copy, Clone)] -struct SettingsFilter<'a> { - pub history: &'a RegexSet, - pub cwd: &'a RegexSet, - pub secrets: bool, } #[cfg(test)] -- cgit v1.3.1