diff options
| author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-06-13 00:58:32 +0200 |
|---|---|---|
| committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-06-13 00:58:32 +0200 |
| commit | 9352a0f7cfdd5f5fc102a25d8a93218bc3dbe462 (patch) | |
| tree | b998430c307c10defb79d91abe5d30471c5c4f12 /crates/turtle/src/atuin_client/history.rs | |
| parent | chore(treewide): Remove `cargo` warnings to 0 (diff) | |
| download | atuin-9352a0f7cfdd5f5fc102a25d8a93218bc3dbe462.zip | |
chore(treewide): Fix some of `clippy`'s error
Just a run of `cargo clippy --fix`
Diffstat (limited to 'crates/turtle/src/atuin_client/history.rs')
| -rw-r--r-- | crates/turtle/src/atuin_client/history.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/turtle/src/atuin_client/history.rs b/crates/turtle/src/atuin_client/history.rs index 11d60548..c38d8ccc 100644 --- a/crates/turtle/src/atuin_client/history.rs +++ b/crates/turtle/src/atuin_client/history.rs @@ -223,7 +223,7 @@ impl History { } } - fn deserialize_v0(bytes: &[u8]) -> Result<History> { + fn deserialize_v0(bytes: &[u8]) -> Result<Self> { use rmp::decode; fn error_report<E: std::fmt::Debug>(err: E) -> eyre::Report { @@ -270,7 +270,7 @@ impl History { bail!("trailing bytes in encoded history. malformed") } - Ok(History { + Ok(Self { id: id.to_owned().into(), timestamp: OffsetDateTime::from_unix_timestamp_nanos(i128::from(timestamp))?, duration, @@ -287,7 +287,7 @@ impl History { }) } - fn deserialize_v1(bytes: &[u8]) -> Result<History> { + fn deserialize_v1(bytes: &[u8]) -> Result<Self> { use rmp::decode; fn error_report<E: std::fmt::Debug>(err: E) -> eyre::Report { @@ -341,7 +341,7 @@ impl History { bail!("trailing bytes in encoded history. malformed") } - Ok(History { + Ok(Self { id: id.to_owned().into(), timestamp: OffsetDateTime::from_unix_timestamp_nanos(i128::from(timestamp))?, duration, @@ -358,7 +358,7 @@ impl History { }) } - pub(crate) fn deserialize(bytes: &[u8], version: &str) -> Result<History> { + pub(crate) fn deserialize(bytes: &[u8], version: &str) -> Result<Self> { match version { HISTORY_VERSION_V0 => Self::deserialize_v0(bytes), HISTORY_VERSION_V1 => Self::deserialize_v1(bytes), |
