aboutsummaryrefslogtreecommitdiffstats
path: root/crates/atuin-client/src/import/replxx.rs
diff options
context:
space:
mode:
authorEllie Huxtable <ellie@atuin.sh>2025-03-19 12:44:20 +0000
committerGitHub <noreply@github.com>2025-03-19 12:44:20 +0000
commit14ec768b4520d4fc34dbf24e663ea7db940c18b7 (patch)
treea37db707ab8676cad5b3e6ca47af3f2997958906 /crates/atuin-client/src/import/replxx.rs
parentfeat: Use readline binding for ctrl-a when it is not the prefix (#2626) (diff)
downloadatuin-14ec768b4520d4fc34dbf24e663ea7db940c18b7.zip
chore: migrate to rust 2024 (#2635)
* chore: upgrade to 2024 edition * ugh unsafe * format * nixxxxxxxxxxx why
Diffstat (limited to 'crates/atuin-client/src/import/replxx.rs')
-rw-r--r--crates/atuin-client/src/import/replxx.rs15
1 files changed, 9 insertions, 6 deletions
diff --git a/crates/atuin-client/src/import/replxx.rs b/crates/atuin-client/src/import/replxx.rs
index b73522ce..e1590c69 100644
--- a/crates/atuin-client/src/import/replxx.rs
+++ b/crates/atuin-client/src/import/replxx.rs
@@ -2,10 +2,10 @@ use std::{path::PathBuf, str};
use async_trait::async_trait;
use directories::UserDirs;
-use eyre::{eyre, Result};
-use time::{macros::format_description, OffsetDateTime, PrimitiveDateTime};
+use eyre::{Result, eyre};
+use time::{OffsetDateTime, PrimitiveDateTime, macros::format_description};
-use super::{get_histpath, unix_byte_lines, Importer, Loader};
+use super::{Importer, Loader, get_histpath, unix_byte_lines};
use crate::history::History;
use crate::import::read_to_end;
@@ -72,7 +72,7 @@ fn try_parse_line_as_timestamp(line: &str) -> Option<OffsetDateTime> {
#[cfg(test)]
mod test {
- use crate::import::{tests::TestLoader, Importer};
+ use crate::import::{Importer, tests::TestLoader};
use super::Replxx;
@@ -100,7 +100,7 @@ CREATE TABLE test( stamp DateTime('UTC'))ENGINE = MergeTreePARTITION BY toDat
// simple wrapper for replxx history entry
macro_rules! history {
- ($timestamp:expr, $command:expr) => {
+ ($timestamp:expr_2021, $command:expr_2021) => {
let h = history.next().expect("missing entry in history");
assert_eq!(h.command.as_str(), $command);
assert_eq!(h.timestamp.unix_timestamp(), $timestamp);
@@ -114,6 +114,9 @@ CREATE TABLE test( stamp DateTime('UTC'))ENGINE = MergeTreePARTITION BY toDat
history!(1707603396, "select * from numbers(10)");
history!(1707603401, "select * from system.numbers");
history!(1707603568, "select 1");
- history!(1708600533, "CREATE TABLE test\n( stamp DateTime('UTC'))\nENGINE = MergeTree\nPARTITION BY toDate(stamp)\norder by tuple() as select toDateTime('2020-01-01')+number*60 from numbers(80000);");
+ history!(
+ 1708600533,
+ "CREATE TABLE test\n( stamp DateTime('UTC'))\nENGINE = MergeTree\nPARTITION BY toDate(stamp)\norder by tuple() as select toDateTime('2020-01-01')+number*60 from numbers(80000);"
+ );
}
}