Move linking logic from uniondepot importer to runner
Dependencies
- [2]
XQHYMSDYAdd importer for Union Investment transactions - [3]
YBARPI2BMake account templates owned - [4]
5S4MZHL5pretty print decimals using icu - [5]
2JBFREZGenable additional warnings - [6]
R7S2CWF7Add type for account segments - [7]
YDK6X6PPadd a library of important types for beancount - [*]
I2P2FTLEadd basic parser for german decimals
Change contents
- edit in importers/uniondepot/src/lib.rs at line 4
use core::hash::Hash; - edit in importers/uniondepot/src/lib.rs at line 16
use beancount_types::Link; - edit in importers/uniondepot/src/lib.rs at line 27
use xxhash_rust::xxh3::Xxh3; - edit in importers/uniondepot/src/lib.rs at line 256
TransactionKind::Purchase | TransactionKind::Sale) {transaction.add_link(Link::try_from(format!("^union-investment.{:X}", hash(date, &context))).unwrap(),);}if matches!(transaction_kind, - edit in importers/uniondepot/src/lib.rs at line 455
}fn hash(date: Date, context: &TemplateContext) -> u128 {let mut hasher = Xxh3::new();(context.depot, context.position, date.year(), date.month()).hash(&mut hasher);hasher.digest128() - edit in importers/uniondepot/Cargo.toml at line 23
xxhash-rust.workspace = true - edit in beancount/account/src/lib.rs at line 1
#![warn(clippy::all, clippy::nursery, clippy::pedantic)] - replacement in beancount/account/src/lib.rs at line 48
/// Produces an iterator over the segments of the path.pub fn segments(&self) -> Segments<'_> {Segments {inner: self.name.split(':'),/// Returns the final segment of the account name.#[must_use]pub fn leaf_name(&self) -> &Seg {let leaf = self.name.rsplit_once(':').map_or(&self.name, |(_, leaf)| leaf);unsafe {// SAFETY: By construction, if `self` is a valid account name, `leaf` is a valid account segment.Seg::from_unchecked(leaf) - replacement in beancount/account/src/lib.rs at line 65
self.name.split_once(':').map(|(parent, _)| {self.name.rsplit_once(':').map(|(parent, _)| { - edit in beancount/account/src/lib.rs at line 72
}/// Produces an iterator over the segments of the path.pub fn segments(&self) -> Segments<'_> {Segments {inner: self.name.split(':'),} - edit in beancount/account/src/lib.rs at line 80
} - edit in beancount/account/src/lib.rs at line 82
impl Acc { - replacement in beancount/account/src/lib.rs at line 155
self.name.hash(state)self.name.hash(state); - replacement in beancount/account/src/lib.rs at line 292
impl PartialOrd<Cow<'_, Acc>> for Acc {fn partial_cmp(&self, other: &Cow<'_, Acc>) -> Option<Ordering> {impl PartialOrd<Cow<'_, Self>> for Acc {fn partial_cmp(&self, other: &Cow<'_, Self>) -> Option<Ordering> { - replacement in beancount/account/src/lib.rs at line 420
impl From<&Account> for Account {impl From<&Self> for Account { - replacement in beancount/account/src/lib.rs at line 422
fn from(value: &Account) -> Self {fn from(value: &Self) -> Self { - replacement in beancount/account/src/lib.rs at line 439
(**self).hash(state)(**self).hash(state); - edit in Cargo.lock at line 4324
"xxhash-rust",