summaryrefslogtreecommitdiffstats
path: root/atuin-client/src/encryption.rs
diff options
context:
space:
mode:
authorEllie Huxtable <ellie@elliehuxtable.com>2024-01-06 17:19:31 +0000
committerGitHub <noreply@github.com>2024-01-06 17:19:31 +0000
commit4e56f5a41e5224b816e9eafed145a03cbf52fd93 (patch)
tree3177cadbced62db723efaf6a7764f37e3c0e318a /atuin-client/src/encryption.rs
parent179c6d20ef8f10fd4dcc1be57e05ed4b02e8c123 (diff)
refactor: String -> HistoryId (#1512)
Diffstat (limited to 'atuin-client/src/encryption.rs')
-rw-r--r--atuin-client/src/encryption.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/atuin-client/src/encryption.rs b/atuin-client/src/encryption.rs
index f9f8bcb32..3c9f3d068 100644
--- a/atuin-client/src/encryption.rs
+++ b/atuin-client/src/encryption.rs
@@ -166,7 +166,7 @@ fn encode(h: &History) -> Result<Vec<u8>> {
// INFO: ensure this is updated when adding new fields
encode::write_array_len(&mut output, 9)?;
- encode::write_str(&mut output, &h.id)?;
+ encode::write_str(&mut output, &h.id.0)?;
encode::write_str(&mut output, &(format_rfc3339(h.timestamp)?))?;
encode::write_sint(&mut output, h.duration)?;
encode::write_sint(&mut output, h.exit)?;
@@ -234,7 +234,7 @@ fn decode(bytes: &[u8]) -> Result<History> {
}
Ok(History {
- id: id.to_owned(),
+ id: id.to_owned().into(),
timestamp: OffsetDateTime::parse(timestamp, &Rfc3339)?,
duration,
exit,
@@ -312,7 +312,7 @@ mod test {
108, 117, 100, 103, 97, 116, 101, 192,
];
let history = History {
- id: "66d16cbee7cd47538e5c5b8b44e9006e".to_owned(),
+ id: "66d16cbee7cd47538e5c5b8b44e9006e".to_owned().into(),
timestamp: datetime!(2023-05-28 18:35:40.633872 +00:00),
duration: 49206000,
exit: 0,
@@ -333,7 +333,7 @@ mod test {
#[test]
fn test_decode_deleted() {
let history = History {
- id: "66d16cbee7cd47538e5c5b8b44e9006e".to_owned(),
+ id: "66d16cbee7cd47538e5c5b8b44e9006e".to_owned().into(),
timestamp: datetime!(2023-05-28 18:35:40.633872 +00:00),
duration: 49206000,
exit: 0,
@@ -364,7 +364,7 @@ mod test {
108, 117, 100, 103, 97, 116, 101,
];
let history = History {
- id: "66d16cbee7cd47538e5c5b8b44e9006e".to_owned(),
+ id: "66d16cbee7cd47538e5c5b8b44e9006e".to_owned().into(),
timestamp: datetime!(2023-05-28 18:35:40.633872 +00:00),
duration: 49206000,
exit: 0,