Skip to content

Commit

Permalink
Remove some method never used
Browse files Browse the repository at this point in the history
  • Loading branch information
EVaillant committed May 6, 2024
1 parent 351c77b commit dbe08a7
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions src/historical/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ impl DataFrame {

pub trait Provider {
fn fetch(&mut self, instrument: &Instrument, begin: Date, end: Date) -> Result<(), Error>;
fn get(&self, instrument: &Instrument, date: Date) -> Option<&DataFrame>;
fn latest(&self, instrument: &Instrument, date: Date) -> Option<&DataFrame>;
}

Expand Down Expand Up @@ -73,10 +72,6 @@ impl CacheInstrument {
Self { begin, end, data }
}

fn get(&self, date: Date) -> Option<&DataFrame> {
self.data.iter().find(|item| item.date == date)
}

fn latest(&self, date: Date) -> Option<&DataFrame> {
self.data.iter().rev().find(|item| item.date <= date)
}
Expand Down Expand Up @@ -227,13 +222,6 @@ where
Ok(())
}

fn get(&self, instrument: &Instrument, date: Date) -> Option<&DataFrame> {
match self.cache.get(&instrument.name) {
Some(item) => item.get(date),
None => None,
}
}

fn latest(&self, instrument: &Instrument, date: Date) -> Option<&DataFrame> {
match self.cache.get(&instrument.name) {
Some(item) => item.latest(date),
Expand Down

0 comments on commit dbe08a7

Please sign in to comment.