diff options
Diffstat (limited to 'crates/turtle/src/command/client/history.rs')
| -rw-r--r-- | crates/turtle/src/command/client/history.rs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/crates/turtle/src/command/client/history.rs b/crates/turtle/src/command/client/history.rs index 2ddcb3a6..e574a2e9 100644 --- a/crates/turtle/src/command/client/history.rs +++ b/crates/turtle/src/command/client/history.rs @@ -14,7 +14,7 @@ use super::daemon as daemon_cmd; use colored::Colorize; use serde::Serialize; -use crate::atuin_daemon::history::{HistoryEventKind, TailHistoryReply}; +use crate::atuin_daemon::generated::history::{HistoryEventKind, TailHistoryReply}; use crate::atuin_client::{ database::{ClientSqlite, current_context}, @@ -166,11 +166,11 @@ pub(crate) enum ListMode { impl ListMode { pub(crate) const fn from_flags(human: bool, cmd_only: bool) -> Self { if human { - ListMode::Human + Self::Human } else if cmd_only { - ListMode::CmdOnly + Self::CmdOnly } else { - ListMode::Regular + Self::Regular } } } @@ -183,7 +183,7 @@ pub(crate) fn print_list( reverse: bool, tz: Timezone, ) { - let w = std::io::stdout(); + let w = io::stdout(); let mut w = w.lock(); let fmt_str = match list_mode { @@ -202,6 +202,7 @@ pub(crate) fn print_list( ListMode::CmdOnly => std::iter::once(ParseSegment::Key("command")).collect(), }; + #[allow(trivial_casts)] let iterator = if reverse { Box::new(h.iter().rev()) as Box<dyn Iterator<Item = &History>> } else { @@ -743,10 +744,10 @@ fn normalize_optional_field(value: &str) -> Option<String> { impl Cmd { async fn handle_tail(settings: &Settings) -> Result<()> { - let tty = std::io::stdout().is_terminal(); + let tty = io::stdout().is_terminal(); let mut client = daemon::tail_client(settings).await?; let mut stream = client.tail_history().await?; - let stdout = std::io::stdout(); + let stdout = io::stdout(); while let Some(reply) = stream.message().await? { let event = TailEvent::from_proto(reply)?; |
