aboutsummaryrefslogtreecommitdiffstats
path: root/crates/turtle/src/atuin_history
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-06-11 14:20:49 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-06-11 14:20:49 +0200
commit199563550dd41c3dfb703bd3747604a8a03cdbc5 (patch)
tree30cfa3e5539f782b7571091c742ee1c219e138fb /crates/turtle/src/atuin_history
parentchore: Restore db migrations (diff)
downloadatuin-199563550dd41c3dfb703bd3747604a8a03cdbc5.zip
chore: Remove all `pub`s
They will not be marked by rustc/cargo as unused, and as atuin doesn't expose an API all of them _should_ be `pub(crate)`
Diffstat (limited to 'crates/turtle/src/atuin_history')
-rw-r--r--crates/turtle/src/atuin_history/mod.rs4
-rw-r--r--crates/turtle/src/atuin_history/sort.rs2
-rw-r--r--crates/turtle/src/atuin_history/stats.rs12
3 files changed, 9 insertions, 9 deletions
diff --git a/crates/turtle/src/atuin_history/mod.rs b/crates/turtle/src/atuin_history/mod.rs
index e7b33916..41336a14 100644
--- a/crates/turtle/src/atuin_history/mod.rs
+++ b/crates/turtle/src/atuin_history/mod.rs
@@ -1,2 +1,2 @@
-pub mod sort;
-pub mod stats;
+pub(crate) mod sort;
+pub(crate) mod stats;
diff --git a/crates/turtle/src/atuin_history/sort.rs b/crates/turtle/src/atuin_history/sort.rs
index b162c810..3143fa68 100644
--- a/crates/turtle/src/atuin_history/sort.rs
+++ b/crates/turtle/src/atuin_history/sort.rs
@@ -6,7 +6,7 @@ type ScoredHistory = (f64, History);
// This sorting should be applicable to all search modes, and solve the more "obvious" issues
// first.
// Later on, we can pass in context and do some boosts there too.
-pub fn sort(query: &str, input: Vec<History>) -> Vec<History> {
+pub(crate) fn sort(query: &str, input: Vec<History>) -> Vec<History> {
// This can totally be extended. We need to be _careful_ that it's not slow.
// We also need to balance sorting db-side with sorting here. SQLite can do a lot,
// but some things are just much easier/more doable in Rust.
diff --git a/crates/turtle/src/atuin_history/stats.rs b/crates/turtle/src/atuin_history/stats.rs
index e47d6c8e..12d1ffc5 100644
--- a/crates/turtle/src/atuin_history/stats.rs
+++ b/crates/turtle/src/atuin_history/stats.rs
@@ -7,10 +7,10 @@ use unicode_segmentation::UnicodeSegmentation;
use crate::atuin_client::{history::History, settings::Settings, theme::Meaning, theme::Theme};
#[derive(Debug, Clone, Serialize, Deserialize)]
-pub struct Stats {
- pub total_commands: usize,
- pub unique_commands: usize,
- pub top: Vec<(Vec<String>, usize)>,
+pub(crate) struct Stats {
+ pub(crate) total_commands: usize,
+ pub(crate) unique_commands: usize,
+ pub(crate) top: Vec<(Vec<String>, usize)>,
}
fn first_non_whitespace(s: &str) -> Option<usize> {
@@ -162,7 +162,7 @@ fn strip_leading_env_vars(command: &str) -> &str {
command[token_start_pos..].trim()
}
-pub fn pretty_print(stats: Stats, ngram_size: usize, theme: &Theme) {
+pub(crate) fn pretty_print(stats: Stats, ngram_size: usize, theme: &Theme) {
let max = stats.top.iter().map(|x| x.1).max().unwrap();
let num_pad = max.ilog10() as usize + 1;
@@ -239,7 +239,7 @@ pub fn pretty_print(stats: Stats, ngram_size: usize, theme: &Theme) {
println!("Unique commands: {}", stats.unique_commands);
}
-pub fn compute(
+pub(crate) fn compute(
settings: &Settings,
history: &[History],
count: usize,