diff options
| author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-06-13 00:50:54 +0200 |
|---|---|---|
| committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-06-13 00:50:54 +0200 |
| commit | 6723829a3398b3c9dd6dc6ae79124f46000606ee (patch) | |
| tree | a1ec535eddd711a4557e4bcc5b94382c3623504c /crates/turtle/src/atuin_history | |
| parent | chore(treewide): Cleanup themes (diff) | |
| download | atuin-6723829a3398b3c9dd6dc6ae79124f46000606ee.zip | |
chore(treewide): Remove `cargo` warnings to 0
There are still the `clippy` warnings, but they are for a future date.
Diffstat (limited to 'crates/turtle/src/atuin_history')
| -rw-r--r-- | crates/turtle/src/atuin_history/stats.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/crates/turtle/src/atuin_history/stats.rs b/crates/turtle/src/atuin_history/stats.rs index 2328eeca..a19d2d0e 100644 --- a/crates/turtle/src/atuin_history/stats.rs +++ b/crates/turtle/src/atuin_history/stats.rs @@ -170,7 +170,7 @@ pub(crate) fn pretty_print(stats: Stats, ngram_size: usize) { let column_widths = stats .top .iter() - .map(|(commands, _)| commands.iter().map(|c| c.len()).collect::<Vec<usize>>()) + .map(|(commands, _)| commands.iter().map(String::len).collect::<Vec<usize>>()) .fold(vec![0; ngram_size], |acc, item| { acc.iter() .zip(item.iter()) @@ -287,10 +287,10 @@ mod tests { #[test] fn ignored_env_vars() { - let settings = Settings::utc(); + let settings = Settings::new().unwrap(); let history: History = History::capture() - .timestamp(time::OffsetDateTime::now_utc()) + .timestamp(OffsetDateTime::now_utc()) .command("FOO='BAR=🚀' echo foo") .cwd("/") .build() @@ -302,7 +302,7 @@ mod tests { #[test] fn ignored_commands() { - let mut settings = Settings::utc(); + let mut settings = Settings::new().unwrap(); settings.stats.ignored_commands.push("cd".to_string()); let history = [ @@ -325,7 +325,7 @@ mod tests { #[test] fn interesting_commands() { - let settings = Settings::utc(); + let settings = Settings::new().unwrap(); assert_eq!(interesting_command(&settings, "cargo"), "cargo"); assert_eq!( @@ -342,7 +342,7 @@ mod tests { // Test with spaces in the common_prefix #[test] fn interesting_commands_spaces() { - let mut settings = Settings::utc(); + let mut settings = Settings::new().unwrap(); settings.stats.common_prefix.push("sudo test".to_string()); assert_eq!(interesting_command(&settings, "sudo test"), "sudo test"); @@ -367,7 +367,7 @@ mod tests { // Test with spaces in the common_subcommand #[test] fn interesting_commands_spaces_subcommand() { - let mut settings = Settings::utc(); + let mut settings = Settings::new().unwrap(); settings .stats .common_subcommands @@ -397,7 +397,7 @@ mod tests { // Test with spaces in the common_prefix and common_subcommand #[test] fn interesting_commands_spaces_both() { - let mut settings = Settings::utc(); + let mut settings = Settings::new().unwrap(); settings.stats.common_prefix.push("sudo test".to_string()); settings .stats |
