Respect directive order when writing trees
Dependencies
- [2]
2NYDNXH7Use OS dependent path separator when constructing paths in tree writer - [3]
MG46NYACenable deserialization of configuration for common utilities - [4]
D6UTHZA4add a simple writer for saving a set of directives to a tree of files - [5]
2JBFREZGenable additional warnings
Change contents
- replacement in common/beancount-tree-writer/src/lib.rs at line 15
use dashmap::DashMap;use itertools::Itertools as _; - replacement in common/beancount-tree-writer/src/lib.rs at line 55
let accounts = DashMap::<_, Vec<_>>::new();directives.into_par_iter().for_each_with(&accounts, |directives, directive| {let index = (&directive).try_into().unwrap();directives.entry(index).or_default().push(directive);});let accounts = directives.into_iter().into_group_map_by(|directive| DirectiveIndex::try_from(directive).unwrap()); - replacement in common/beancount-tree-writer/src/lib.rs at line 80
directives.par_sort_by_key(Directive::date);directives.par_sort_by(|left, right| {left.timestamp().zip(right.timestamp()).map_or_else(|| left.date().cmp(&right.date()),|(left, right)| left.cmp(&right),)});