diff options
| author | Conrad Ludgate <conrad.ludgate@truelayer.com> | 2022-04-21 08:05:57 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-21 08:05:57 +0100 |
| commit | 48747e3b7c542c696003f71ef4b4ae457934e57c (patch) | |
| tree | 0bbde7136b84cda46cdb758d2cbeda67ca436ee8 /atuin-client/src/history.rs | |
| parent | Use the count cache (#312) (diff) | |
| download | atuin-48747e3b7c542c696003f71ef4b4ae457934e57c.zip | |
A few minor tweaks (#314)
* use bail macro
replace client database errors
remove dead code
* fix test
Diffstat (limited to 'atuin-client/src/history.rs')
| -rw-r--r-- | atuin-client/src/history.rs | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/atuin-client/src/history.rs b/atuin-client/src/history.rs index 92e92ddf..111e463a 100644 --- a/atuin-client/src/history.rs +++ b/atuin-client/src/history.rs @@ -1,12 +1,11 @@ use std::env; -use std::hash::{Hash, Hasher}; use chrono::Utc; use atuin_common::utils::uuid_v4; // Any new fields MUST be Optional<>! -#[derive(Debug, Clone, Serialize, Deserialize, Ord, PartialOrd, sqlx::FromRow)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, sqlx::FromRow)] pub struct History { pub id: String, pub timestamp: chrono::DateTime<Utc>, @@ -46,21 +45,3 @@ impl History { } } } - -impl PartialEq for History { - // for the sakes of listing unique history only, we do not care about - // anything else - // obviously this does not refer to the *same* item of history, but when - // we only render the command, it looks the same - fn eq(&self, other: &Self) -> bool { - self.command == other.command - } -} - -impl Eq for History {} - -impl Hash for History { - fn hash<H: Hasher>(&self, state: &mut H) { - self.command.hash(state); - } -} |
