Fix MOVE statement

This commit is contained in:
Joscha 2021-12-06 13:54:23 +00:00
parent cb7c87b8b2
commit 531a140c45

View file

@ -186,7 +186,11 @@ impl<'a> CommandState<'a> {
}
fn eval_move(&mut self, span: Span, from: NaiveDate, to: NaiveDate) -> Result<()> {
if let Some(entry) = self.dated.remove(&from) {
if let Some(mut entry) = self.dated.remove(&from) {
if let Some(dates) = entry.dates {
let delta = to - from;
entry.dates = Some(dates.move_by(delta));
}
self.dated.insert(to, entry);
Ok(())
} else {