Simplify down to show-days

This commit is contained in:
2025-01-09 15:44:09 +01:00
parent f501569040
commit c381ed2a79
8 changed files with 130 additions and 54 deletions

16
src/cli/sort_by.rs Normal file
View File

@ -0,0 +1,16 @@
use clap::ValueEnum;
#[derive(Debug, ValueEnum, Clone)]
pub enum SortBy {
Currency,
Rate,
}
impl SortBy {
pub fn get_comparer(&self) -> fn(&(&str, f64), &(&str, f64)) -> std::cmp::Ordering {
match self {
Self::Currency => |a, b| a.0.cmp(&b.0),
Self::Rate => |a, b| a.1.total_cmp(&b.1),
}
}
}