Skip to main content

Module utils

Module utils 

Source
Expand description

Utility helpers shared across the crate — OID formatting, relative time, text, etc.

Re-exports§

pub use text::truncate_str;
pub use time::fmt_oid;
pub use time::relative_time;
pub use time::short_oid;
pub use time::short_oid_str;

Modules§

text
Text manipulation utilities shared across the crate.
time
Time formatting and OID helpers.

Functions§

ascending_range
Build an ascending Vec<usize> spanning from anchor to target (inclusive), regardless of which is larger.
clamp_next
Next index in a list, clamped at len - 1 (no wrapping). Returns 0 if len is 0.
clamp_selection
Clamp a selection index after a list has been resized.
repo_display_name
Human-readable label for a repository path — the last path component, or "New Tab" when path is None or has no filename.
wrap_next
Next index in a list, wrapping around to 0 after the last element. Returns 0 if len is 0.
wrap_prev
Previous index in a list, wrapping around to len - 1 from index 0. Returns 0 if len is 0.