Make eval compile again

This commit is contained in:
Joscha 2021-12-04 21:42:45 +01:00
parent d8782fa28a
commit de1f4a303f
4 changed files with 79 additions and 257 deletions

36
src/eval/command.rs Normal file
View file

@ -0,0 +1,36 @@
use std::collections::HashMap;
use chrono::NaiveDate;
use crate::files::SourcedCommand;
use super::{DateRange, Entry, Result};
pub struct CommandState<'a> {
command: SourcedCommand<'a>,
range: DateRange,
from: Option<NaiveDate>,
until: Option<NaiveDate>,
entries: HashMap<NaiveDate, Entry>,
}
impl<'a> CommandState<'a> {
pub fn new(command: SourcedCommand<'a>, range: DateRange) -> Self {
Self {
range,
command,
from: None,
until: None,
entries: HashMap::new(),
}
}
pub fn eval(self) -> Result<Self> {
todo!()
}
pub fn entries(self) -> Vec<Entry> {
self.entries.into_values().collect()
}
}