mirror of
https://github.com/lov3b/ecb-rates.git
synced 2025-02-22 18:00:11 +01:00
Resolution days now better correspond to the meaning
This commit is contained in:
parent
1628a4b238
commit
34f40b3602
4
src/cache/cache.rs
vendored
4
src/cache/cache.rs
vendored
@ -55,7 +55,7 @@ impl Cache {
|
||||
match resolution {
|
||||
Resolution::TODAY => self.day.as_ref(),
|
||||
Resolution::HistDays90 => self.hist_90.as_ref(),
|
||||
Resolution::HistDay => self.hist_day.as_ref(),
|
||||
Resolution::HistDaysAll => self.hist_day.as_ref(),
|
||||
}
|
||||
}
|
||||
|
||||
@ -64,7 +64,7 @@ impl Cache {
|
||||
match resolution {
|
||||
Resolution::TODAY => self.day = cache_line_opt,
|
||||
Resolution::HistDays90 => self.hist_90 = cache_line_opt,
|
||||
Resolution::HistDay => self.hist_day = cache_line_opt,
|
||||
Resolution::HistDaysAll => self.hist_day = cache_line_opt,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -47,8 +47,10 @@ pub enum SortBy {
|
||||
#[derive(Debug, Clone, Copy, ValueEnum)]
|
||||
pub enum Resolution {
|
||||
TODAY,
|
||||
#[clap(name = "hist-90-days")]
|
||||
HistDays90,
|
||||
HistDay,
|
||||
#[clap(name = "hist-all-days")]
|
||||
HistDaysAll,
|
||||
}
|
||||
|
||||
impl Resolution {
|
||||
@ -56,7 +58,7 @@ impl Resolution {
|
||||
match self {
|
||||
Resolution::TODAY => ecb_url::TODAY,
|
||||
Resolution::HistDays90 => ecb_url::hist::DAYS_90,
|
||||
Resolution::HistDay => ecb_url::hist::DAILY,
|
||||
Resolution::HistDaysAll => ecb_url::hist::DAYS_ALL,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ pub mod ecb_url {
|
||||
pub const TODAY: &'static str = "https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml";
|
||||
|
||||
pub mod hist {
|
||||
pub const DAILY: &'static str =
|
||||
pub const DAYS_ALL: &'static str =
|
||||
"https://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist.xml";
|
||||
pub const DAYS_90: &'static str =
|
||||
"https://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist-90d.xml";
|
||||
|
Loading…
x
Reference in New Issue
Block a user