enable additional warnings
Dependencies
- [2]
Q54Z5TPAreduce amount of generated data - [3]
UESS5YZEmigrate dependencies into workspace manifest - [4]
I2P2FTLEadd basic parser for german decimals - [5]
SJ6AFVZLremove const configuration in favor of runtime config - [6]
YDK6X6PPadd a library of important types for beancount - [7]
D6UTHZA4add a simple writer for saving a set of directives to a tree of files - [8]
NSWL54NMallow deriving pretty printing config from a set of directives - [9]
CLAGB2U4make Config debuggable - [10]
5S4MZHL5pretty print decimals using icu - [11]
M7VINXOFuse fixed_decimal for decimal formatting - [12]
ONRIF4V7add basic snapshot test for pretty printer - [13]
ND7GASJ4track current column position when writing - [14]
MG46NYACenable deserialization of configuration for common utilities - [15]
QRIJE4AQadd a simple pretty printer for beancount directives - [*]
5PYSO4HI
Change contents
- file addition: deny.toml[17.1]
# This template contains all of the possible sections and their default values# Note that all fields that take a lint level have these possible values:# * deny - An error will be produced and the check will fail# * warn - A warning will be produced, but the check will not fail# * allow - No warning or error will be produced, though in some cases a note# will be# This section is considered when running `cargo deny check licenses`# More documentation for the licenses section can be found here:# https://embarkstudios.github.io/cargo-deny/checks/licenses/cfg.html[licenses]# Blanket approval or denial for OSI-approved or FSF Free/Libre licenses# * both - The license will be approved if it is both OSI-approved *AND* FSF# * either - The license will be approved if it is either OSI-approved *OR* FSF# * osi-only - The license will be approved if is OSI-approved *AND NOT* FSF# * fsf-only - The license will be approved if is FSF *AND NOT* OSI-approved# * neither - This predicate is ignored and the default lint level is usedallow-osi-fsf-free = "either"[licenses.private]# If true, ignores workspace crates that aren't published, or are only# published to private registries.# To see how to mark a crate as unpublished (to the official registry),# visit https://doc.rust-lang.org/cargo/reference/manifest.html#the-publish-field.ignore = true# This section is considered when running `cargo deny check bans`.# More documentation about the 'bans' section can be found here:# https://embarkstudios.github.io/cargo-deny/checks/bans/cfg.html[bans]# Lint level for when a crate version requirement is `*`wildcards = "deny"# The graph highlighting used when creating dotgraphs for crates# with multiple versions# * lowest-version - The path to the lowest versioned duplicate is highlighted# * simplest-path - The path to the version with the fewest edges is highlighted# * all - Both lowest-version and simplest-path are usedhighlight = "all" - file addition: cranky.toml[17.1]
warn = [# rustc-lints"explicit_outlives_requirements","macro_use_extern_crate","meta_variable_misuse","missing_copy_implementations","missing_debug_implementations","noop_method_call","trivial_casts","trivial_numeric_casts","unreachable_pub","unsafe_code","unsafe_op_in_unsafe_fn","unused_import_braces","unused_lifetimes","unused_macro_rules","unused_qualifications","unused_tuple_struct_fields","variant_size_differences",# clippy lints"clippy::alloc_instead_of_core","clippy::cargo","clippy::case_sensitive_file_extension_comparisons","clippy::std_instead_of_alloc","clippy::std_instead_of_core","clippy::unnecessary_self_imports",] - replacement in common/german-decimal/src/lib.rs at line 1
//! This is based on a copy of [`rust_decimal::str`], with adaptations to handle german decimals.//! This is based on a copy of [`Decimal::from_str_exact`], with adaptations to handle german decimals. - replacement in common/german-decimal/src/lib.rs at line 41
/// * SAW_DECIMAL_SEPARATOR - a decimal point has been seen/// * NEGATIVE - we've encountered a `-` and the number is negative/// * SAW_DIGIT - a digit has been encountered (when HAS is false it's invalid)/// * BIG - a number that uses 96 bits instead of only 64 bits/// * FIRST - true if it is the first byte in the string/// * `SAW_DECIMAL_SEPARATOR` - a decimal point has been seen/// * `NEGATIVE` - we've encountered a `-` and the number is negative/// * `SAW_DIGIT` - a digit has been encountered (when HAS is false it's invalid)/// * `BIG` - a number that uses 96 bits instead of only 64 bits/// * `FIRST` - true if it is the first byte in the string - replacement in common/german-decimal/Cargo.toml at line 3
version = "0.0.0-dev.0"edition = "2021"edition.workspace = truepublish.workspace = truerust-version.workspace = trueversion.workspace = true - edit in common/beancount-types/src/transaction.rs at line 1
use core::fmt;use core::fmt::Display;use core::fmt::Formatter;use core::fmt::Write as _;use core::hash::Hash;use time::Date; - edit in common/beancount-types/src/transaction.rs at line 12
use std::fmt::Display;use std::fmt::Write as _;use std::hash::Hash;use time::Date; - replacement in common/beancount-types/src/transaction.rs at line 15
pub flag: Option<TransactionFlag>,pub flag: Option<Flag>, - replacement in common/beancount-types/src/transaction.rs at line 27
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { - replacement in common/beancount-types/src/transaction.rs at line 61
pub flag: TransactionFlag,pub flag: Flag, - replacement in common/beancount-types/src/transaction.rs at line 71
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { - replacement in common/beancount-types/src/transaction.rs at line 98
pub enum TransactionFlag {pub enum Flag { - replacement in common/beancount-types/src/transaction.rs at line 103
impl Display for TransactionFlag {fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {impl Display for Flag {fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { - replacement in common/beancount-types/src/transaction.rs at line 106
TransactionFlag::Complete => '*',TransactionFlag::Incomplete => '!',Flag::Complete => '*',Flag::Incomplete => '!', - edit in common/beancount-types/src/that.rs at line 4
use core::fmt::Debug;use core::hash::Hash;use core::str::FromStr; - edit in common/beancount-types/src/that.rs at line 8
use std::fmt::Debug;use std::hash::Hash;use std::str::FromStr; - edit in common/beancount-types/src/that.rs at line 43
core::{fmt::Debug, hash::Hash, str::FromStr}, - edit in common/beancount-types/src/that.rs at line 45
std::{fmt::Debug, hash::Hash, str::FromStr}, - edit in common/beancount-types/src/that.rs at line 79
core::{fmt::Debug, hash::Hash, str::FromStr}, - edit in common/beancount-types/src/that.rs at line 81
std::{fmt::Debug, hash::Hash, str::FromStr}, - replacement in common/beancount-types/src/lib.rs at line 1
use std::fmt::Display;pub use crate::account::Acc;pub use crate::account::Account;pub use crate::amount::Amount;pub use crate::balance::Balance;pub use crate::commodity::Commodity;pub use crate::cost::CostBasis;pub use crate::transaction::Flag;pub use crate::transaction::Posting;pub use crate::transaction::Transaction;use core::fmt;use core::fmt::Display;use core::fmt::Formatter; - edit in common/beancount-types/src/lib.rs at line 24
pub use crate::account::Acc;pub use crate::account::Account;pub use crate::amount::Amount;pub use crate::balance::Balance;pub use crate::commodity::Commodity;pub use crate::cost::CostBasis;pub use crate::transaction::Posting;pub use crate::transaction::Transaction;pub use crate::transaction::TransactionFlag; - replacement in common/beancount-types/src/lib.rs at line 26
Balance(balance::Balance),Transaction(transaction::Transaction),Balance(Balance),Transaction(Transaction), - replacement in common/beancount-types/src/lib.rs at line 50
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { - replacement in common/beancount-types/src/lib.rs at line 58
impl From<balance::Balance> for Directive {fn from(balance: balance::Balance) -> Self {impl From<Balance> for Directive {fn from(balance: Balance) -> Self { - replacement in common/beancount-types/src/lib.rs at line 64
impl From<transaction::Transaction> for Directive {fn from(transaction: transaction::Transaction) -> Self {impl From<Transaction> for Directive {fn from(transaction: Transaction) -> Self { - replacement in common/beancount-types/src/cost.rs at line 2
use std::fmt::Display;use std::hash::Hash;use core::fmt;use core::fmt::Display;use core::fmt::Formatter;use core::hash::Hash; - replacement in common/beancount-types/src/cost.rs at line 7
#[derive(Clone, Debug, Eq, Hash, PartialEq)]#[derive(Clone, Copy, Debug, Hash, PartialEq)] - replacement in common/beancount-types/src/cost.rs at line 15
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { - edit in common/beancount-types/src/commodity.rs at line 1
use core::borrow::Borrow;use core::cmp::Ordering;use core::fmt;use core::fmt::Display;use core::fmt::Formatter;use core::ops::Deref;use core::str::FromStr; - edit in common/beancount-types/src/commodity.rs at line 13
use std::fmt::Display;use std::str::FromStr; - edit in common/beancount-types/src/commodity.rs at line 17
}impl AsRef<str> for Commodity {fn as_ref(&self) -> &str {self}}impl Borrow<str> for Commodity {fn borrow(&self) -> &str {self} - edit in common/beancount-types/src/commodity.rs at line 31
impl Deref for Commodity {type Target = str;delegate::delegate! {to self.name {fn deref(&self) -> &Self::Target;}}} - replacement in common/beancount-types/src/commodity.rs at line 42
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { - edit in common/beancount-types/src/commodity.rs at line 52
}}impl PartialEq<Commodity> for str {fn eq(&self, other: &Commodity) -> bool {other.eq(self)}}impl PartialEq<str> for Commodity {fn eq(&self, other: &str) -> bool {self.partial_cmp(other).map(Ordering::is_eq).unwrap_or_default()}}impl PartialOrd<Commodity> for str {fn partial_cmp(&self, other: &Commodity) -> Option<Ordering> {other.partial_cmp(self) - edit in common/beancount-types/src/commodity.rs at line 75
impl PartialOrd<str> for Commodity {fn partial_cmp(&self, other: &str) -> Option<Ordering> {self.name.partial_cmp(other)}} - edit in common/beancount-types/src/commodity.rs at line 95
impl TryFrom<String> for Commodity {type Error = CommodityError;fn try_from(value: String) -> Result<Self, Self::Error> {Self::try_from(&*value)}} - edit in common/beancount-types/src/balance.rs at line 1
use core::fmt::Display;use core::hash::Hash;use time::Date; - edit in common/beancount-types/src/balance.rs at line 8
use std::fmt::Display;use std::hash::Hash;use time::Date; - replacement in common/beancount-types/src/balance.rs at line 9
#[derive(Clone, Debug, Eq, Hash, PartialEq)]#[derive(Clone, Debug, Hash, PartialEq, PartialOrd)] - replacement in common/beancount-types/src/balance.rs at line 19
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - replacement in common/beancount-types/src/amount.rs at line 1
use crate::Commodity;use core::fmt;use core::fmt::Display;use core::fmt::Formatter;use core::hash::Hash;use core::hash::Hasher;use core::ops::Add;use core::ops::AddAssign;use core::ops::Div;use core::ops::DivAssign;use core::ops::Mul;use core::ops::MulAssign;use core::ops::Neg;use core::ops::Sub;use core::ops::SubAssign;use core::str::FromStr; - replacement in common/beancount-types/src/amount.rs at line 21
use std::fmt::Display;use std::ops::Neg;use std::str::FromStr;use crate::Commodity;macro_rules! forward_commutative_binop {(impl $trait:ident<$ltype:ty> for $rtype:ty { $fn:ident }) => {forward_commutative_binop!(@single<'l> $trait, $fn, &'l $ltype, &$rtype);forward_commutative_binop!(@single<'l> $trait, $fn, &'l $ltype, $rtype);forward_commutative_binop!(@single $trait, $fn, $ltype, &$rtype);forward_commutative_binop!(@single $trait, $fn, $ltype, $rtype);};(@single$(<$lt:lifetime>)? $trait:ident, $fn:ident, $ltype:ty, $rtype:ty) => {impl$(<$lt>)? $trait<$ltype> for $rtype {type Output = <$ltype as $trait<Self>>::Output;#[inline]fn $fn(self, rhs: $ltype) -> Self::Output {rhs.$fn(self)}}};}macro_rules! implement_binop {(impl $trait:ident<$rtype:ty> for $ltype:ty { fn $method:ident($self:ident, $rhs:ident) $body:block }) => {implement_binop! {@singleimpl $trait<&'_ $rtype> for &'_ $ltype {fn $method($self, $rhs) -> $ltype {(*$self).$method($rhs)}}}implement_binop! {@singleimpl $trait<&'_ $rtype> for $ltype {fn $method($self, $rhs) -> $ltype $body}}implement_binop! {@singleimpl $trait<$rtype> for &'_ $ltype {fn $method($self, $rhs) -> $ltype {$self.$method(&$rhs)}}}implement_binop! {@singleimpl $trait<$rtype> for $ltype {fn $method($self, $rhs) -> $ltype {$self.$method(&$rhs)}}}};(@single impl $trait:ident<$rtype:ty> for $ltype:ty { fn $method:ident($self:ident, $rhs:ident) -> $output:ty $body:block }) => {impl $trait<$rtype> for $ltype {type Output = $output; - replacement in common/beancount-types/src/amount.rs at line 79
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]#[inline]fn $method($self, $rhs: $rtype) -> Self::Output $body}};}macro_rules! implement_binop_assign {(impl $trait:ident<$rtype:ty> for $ltype:ty { fn $method:ident($self:ident, $rhs:ident) $body:block }) => {implement_binop_assign! {@singleimpl $trait<&'_ $rtype> for $ltype {fn $method($self, $rhs) $body}}implement_binop_assign!(@single impl $trait<$rtype> for $ltype { fn $method($self, $rhs) { $self.$method(&$rhs)} });};(@single impl $trait:ident<$rtype:ty> for $ltype:ty { fn $method:ident($self:ident, $rhs:ident) $body:block }) => {impl $trait<$rtype> for $ltype {#[inline]fn $method(&mut $self, $rhs: $rtype) $body}};}macro_rules! implement_binop_complete {(@com impl $assign_trait:ident<$rtype:ty> for $ltype:ty { fn $assign_method:ident($self:ident, $rhs:ident) $body:block } .. $op_trait:ident { $op_method:ident }) => {forward_commutative_binop! {impl $op_trait<$ltype> for $rtype { $op_method }}implement_binop_complete!(impl $assign_trait<$rtype> for $ltype { fn $assign_method($self, $rhs) $body } .. $op_trait { $op_method });};(impl $assign_trait:ident<$rtype:ty> for $ltype:ty { fn $assign_method:ident($self:ident, $rhs:ident) $body:block } .. $op_trait:ident { $op_method:ident }) => {implement_binop! {impl $op_trait<$rtype> for $ltype {fn $op_method($self, $rhs) {let mut this = $self;this.$assign_method($rhs);this}}}implement_binop_assign! {impl $assign_trait<$rtype> for $ltype {fn $assign_method($self, $rhs) $body}}};}#[derive(Clone, Copy, Debug)] - edit in common/beancount-types/src/amount.rs at line 133
}impl Amount {#[inline]pub fn checked_add(self, rhs: Self) -> Option<Self> {self.try_reduce(rhs, Decimal::checked_add)}#[inline]pub fn checked_div(self, rhs: Self) -> Option<Self> {self.try_reduce(rhs, Decimal::checked_div)}#[inline]pub fn checked_mul(self, rhs: Self) -> Option<Self> {self.try_reduce(rhs, Decimal::checked_mul)}#[inline]pub fn checked_sub(self, rhs: Self) -> Option<Self> {self.try_reduce(rhs, Decimal::checked_sub)}#[inline]pub fn saturating_add(self, rhs: Self) -> Option<Self> {self.reduce(rhs, Decimal::saturating_add)}#[inline]pub fn saturating_mul(self, rhs: Self) -> Option<Self> {self.reduce(rhs, Decimal::saturating_mul)}#[inline]pub fn saturating_sub(self, rhs: Self) -> Option<Self> {self.reduce(rhs, Decimal::saturating_sub)}}impl Amount {#[inline]fn reduce(self, rhs: Self, f: impl FnOnce(Decimal, Decimal) -> Decimal) -> Option<Self> {self.try_reduce(rhs, |lhs, rhs| Some(f(lhs, rhs)))}#[inline]fn try_reduce(self,rhs: Self,f: impl FnOnce(Decimal, Decimal) -> Option<Decimal>,) -> Option<Self> {(self.commodity == rhs.commodity).then_some((self.amount, rhs.amount)).and_then(|(lhs, rhs)| f(lhs, rhs)).map(|amount| Self { amount, ..self })}}implement_binop_complete! {impl AddAssign<Amount> for Amount {fn add_assign(self, rhs) {assert!(self.commodity == rhs.commodity);self.amount.add_assign(rhs.amount);}}.. Add { add } - replacement in common/beancount-types/src/amount.rs at line 202
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { - edit in common/beancount-types/src/amount.rs at line 205
}}implement_binop_complete! {impl DivAssign<Decimal> for Amount {fn div_assign(self, rhs) {self.amount.div_assign(rhs);} - edit in common/beancount-types/src/amount.rs at line 214
.. Div { div } - edit in common/beancount-types/src/amount.rs at line 222
}}impl Hash for Amount {fn hash<H: Hasher>(&self, state: &mut H) {self.commodity.hash(state);self.amount.hash(state);}}implement_binop_complete! {@comimpl MulAssign<Decimal> for Amount {fn mul_assign(self, rhs) {self.amount.mul_assign(rhs);}}.. Mul { mul }}impl Neg for &Amount {type Output = Amount;#[inline]fn neg(self) -> Self::Output {(*self).neg() - edit in common/beancount-types/src/amount.rs at line 254
#[inline] - replacement in common/beancount-types/src/amount.rs at line 256
Self {amount: -self.amount,..self}let amount = self.amount.neg();Self { amount, ..self }}}impl PartialEq for Amount {fn eq(&self, other: &Self) -> bool {self.partial_cmp(other).map(core::cmp::Ordering::is_eq).unwrap_or_default() - replacement in common/beancount-types/src/amount.rs at line 270
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {fn partial_cmp(&self, other: &Self) -> Option<core::cmp::Ordering> { - edit in common/beancount-types/src/amount.rs at line 272
}}implement_binop_complete! {impl SubAssign<Amount> for Amount {fn sub_assign(self, rhs) {assert!(self.commodity == rhs.commodity);self.amount.sub_assign(rhs.amount);} - edit in common/beancount-types/src/amount.rs at line 282
.. Sub { sub } - edit in common/beancount-types/src/account.rs at line 1
extern crate alloc;use core::borrow::Borrow;use core::cmp::Ordering;use core::fmt;use core::fmt::Display;use core::fmt::Formatter;use core::hash::Hash;use core::hash::Hasher;use core::iter::FusedIterator;use core::ops::Deref;use core::str::FromStr;use core::str::Split;use alloc::borrow::Cow; - edit in common/beancount-types/src/account.rs at line 17
use momo::momo; - edit in common/beancount-types/src/account.rs at line 21
use std::borrow::Borrow;use std::borrow::Cow;use std::cmp::Ordering;use std::fmt::Display;use std::hash::Hash;use std::iter::FusedIterator;use std::ops::Deref;use std::str::FromStr;use std::str::Split; - edit in common/beancount-types/src/account.rs at line 24
/// A borrowed account name (akin to [`str`])////// This type supports a number of operations for inspecting an account name, including breaking the account name into its segments.////// This is an _unsized_ type, meaning that it must always be used behind a pointer like `&` or [`Box`]./// For an owned version of this type see, see [`Account`]. - edit in common/beancount-types/src/account.rs at line 35
/// Produces an iterator over `Acc` and its ancestors.////// The iterator will yield all `Acc`s that are returned if the [`parent`](Self::parent) method is used zero or more times./// The iterator will always yield at least one value, namely `&self`. - edit in common/beancount-types/src/account.rs at line 43
/// Produces an iterator over the segments of the path. - edit in common/beancount-types/src/account.rs at line 50
/// Returns the account name without the final segment, if there is one.#[must_use] - replacement in common/beancount-types/src/account.rs at line 53
self.name.split_once(':').map(|(parent, _)| unsafe { Self::from_unchecked(parent) })self.name.split_once(':').map(|(parent, _)| {#[allow(unsafe_code)]unsafe {// SAFETY: By construction, if `self` is a valid account name, `self.parent` is also a valid account name.Self::from_unchecked(parent)}}) - edit in common/beancount-types/src/account.rs at line 62
/// Create a new `Acc` from a `str` without validating the name before.////// # Safety////// Other functions on this type assume that `name` is a valid account name, as defined by beancount./// You must ensure that this is the case./// See [`is_valid_account_name`] for a function providing that guarantee.#[allow(unsafe_code)] - replacement in common/beancount-types/src/account.rs at line 71
&*(name as *const _ as *const _)unsafe {// SAFETY: Acc is repr(transparent), so it has the same representation as a str, which makes the cast safe.let name: *const _ = name;let name = name as *const _;&*name} - replacement in common/beancount-types/src/account.rs at line 96
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { - replacement in common/beancount-types/src/account.rs at line 107
H: std::hash::Hasher,H: Hasher, - replacement in common/beancount-types/src/account.rs at line 109
self.name.hash(state);self.name.hash(state) - replacement in common/beancount-types/src/account.rs at line 287
Ok(unsafe { Acc::from_unchecked(name) })Ok(#[allow(unsafe_code)]unsafe {// SAFETY: we have ensured that `name` is valid.Acc::from_unchecked(name)},) - edit in common/beancount-types/src/account.rs at line 304
#[momo] - replacement in common/beancount-types/src/account.rs at line 369
unsafe { Acc::from_unchecked(&self.name) }#[allow(unsafe_code)]unsafe {// SAFETY: `self` is a valid `Account`, therefore `self.name` is a valid account name, by construction.Acc::from_unchecked(&self.name)} - replacement in common/beancount-types/src/account.rs at line 379
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { - replacement in common/beancount-types/src/account.rs at line 404
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {fn hash<H: Hasher>(&self, state: &mut H) { - edit in common/beancount-types/src/account.rs at line 652
#[must_use] - edit in common/beancount-types/src/account.rs at line 670
#[must_use] - edit in common/beancount-types/Cargo.toml at line 5
publish.workspace = true - edit in common/beancount-types/Cargo.toml at line 14
momo.workspace = true - replacement in common/beancount-tree-writer/src/lib.rs at line 1
pub use config::Config;pub use crate::config::Config;use core::fmt::Write as _;use std::fs;use std::fs::File;use std::io; - edit in common/beancount-tree-writer/src/lib.rs at line 20
use std::fmt::Write as _;use std::fs;use std::fs::File;use std::io; - edit in common/beancount-tree-writer/src/lib.rs at line 21
use crate::config::PrettyPrinterConfig; - edit in common/beancount-tree-writer/src/lib.rs at line 29
#[derive(Debug)] - replacement in common/beancount-tree-writer/src/lib.rs at line 31
config: config::Config,config: Config, - replacement in common/beancount-tree-writer/src/lib.rs at line 35
pub fn new(config: config::Config) -> Self {pub fn new(config: Config) -> Self { - replacement in common/beancount-tree-writer/src/lib.rs at line 43
config::PrettyPrinterConfig::GloballyDerived => Some(PrettyPrinterConfig::GloballyDerived => Some( - replacement in common/beancount-tree-writer/src/lib.rs at line 46
config::PrettyPrinterConfig::LocallyDerived => None,config::PrettyPrinterConfig::Static(config) => Some(config),PrettyPrinterConfig::LocallyDerived => None,PrettyPrinterConfig::Static(config) => Some(config), - replacement in common/beancount-tree-writer/src/lib.rs at line 174
type Result<T, E = Error> = std::result::Result<T, E>;[4.1632]type Result<T, E = Error> = core::result::Result<T, E>; - file addition: config.rs[4.50]
use camino::Utf8PathBuf;use core::fmt;use core::fmt::Formatter;use core::marker::PhantomData;use serde::Deserialize;use serde::Deserializer;#[derive(Clone, Debug)]pub struct Config {pub output_path: Utf8PathBuf,pub pretty_printer: PrettyPrinterConfig,}impl<'de> Deserialize<'de> for Config {fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>whereD: Deserializer<'de>,{enum Field {OutputPath,PrettyPrinter,Ignored,}struct FieldVisitor;impl<'de> serde::de::Visitor<'de> for FieldVisitor {type Value = Field;fn expecting(&self, formatter: &mut Formatter) -> fmt::Result {formatter.write_str("field identifier")}fn visit_u64<E>(self, value: u64) -> Result<Self::Value, E>whereE: serde::de::Error,{match value {0u64 => Ok(Field::OutputPath),1u64 => Ok(Field::PrettyPrinter),_ => Ok(Field::Ignored),}}fn visit_str<E>(self, value: &str) -> Result<Self::Value, E>whereE: serde::de::Error,{match value {"output_path" => Ok(Field::OutputPath),"pretty_printer" => Ok(Field::PrettyPrinter),_ => Ok(Field::Ignored),}}fn visit_bytes<E>(self, value: &[u8]) -> Result<Self::Value, E>whereE: serde::de::Error,{match value {b"output_path" => Ok(Field::OutputPath),b"pretty_printer" => Ok(Field::PrettyPrinter),_ => Ok(Field::Ignored),}}}impl<'de> Deserialize<'de> for Field {#[inline]fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>whereD: Deserializer<'de>,{deserializer.deserialize_identifier(FieldVisitor)}}struct Visitor<'de> {lifetime: PhantomData<&'de ()>,}impl<'de> serde::de::Visitor<'de> for Visitor<'de> {type Value = Config;fn expecting(&self, formatter: &mut Formatter) -> fmt::Result {formatter.write_str("struct Config")}#[inline]fn visit_seq<A>(self, mut seq: A) -> Result<Self::Value, A::Error>whereA: serde::de::SeqAccess<'de>,{let output_path = seq.next_element::<Utf8PathBuf>()?.ok_or_else(|| {serde::de::Error::invalid_length(0, &"struct Config with 2 elements")}).and_then(|path| path.canonicalize_utf8().map_err(serde::de::Error::custom))?;let pretty_printer = seq.next_element::<PrettyPrinterConfig>()?.unwrap_or_default();Ok(Config {output_path,pretty_printer,})}#[inline]fn visit_map<A>(self, mut map: A) -> Result<Self::Value, A::Error>whereA: serde::de::MapAccess<'de>,{let mut output_path: Option<Utf8PathBuf> = None;let mut pretty_printer: Option<PrettyPrinterConfig> = None;while let Some(key) = map.next_key::<Field>()? {match key {Field::OutputPath if output_path.is_some() => {return Err(serde::de::Error::duplicate_field("output_path"));}Field::OutputPath => {output_path = Some(map.next_value::<Utf8PathBuf>()?);}Field::PrettyPrinter if pretty_printer.is_some() => {return Err(serde::de::Error::duplicate_field("pretty_printer"));}Field::PrettyPrinter => {pretty_printer = Some(map.next_value::<PrettyPrinterConfig>()?);}_ => {map.next_value::<serde::de::IgnoredAny>()?;}}}let output_path = output_path.ok_or_else(|| serde::de::Error::missing_field("output_path")).and_then(|path| path.canonicalize_utf8().map_err(serde::de::Error::custom))?;let pretty_printer = pretty_printer.unwrap_or_default();Ok(Config {output_path,pretty_printer,})}}const FIELDS: &[&str] = &["output_path", "pretty_printer"];deserializer.deserialize_struct("Config",FIELDS,Visitor {lifetime: PhantomData,},)}}#[derive(Clone, Copy, Debug, Default, Deserialize)]pub enum PrettyPrinterConfig {#[default]GloballyDerived,LocallyDerived,Static(beancount_pretty_printer::Config),} - replacement in common/beancount-tree-writer/Cargo.toml at line 3
version = "0.0.0-dev.0"edition = "2021"edition.workspace = truepublish.workspace = truerust-version.workspace = trueversion.workspace = true - edit in common/beancount-pretty-printer/tests/snapshotting.rs at line 1
#![allow(clippy::all, clippy::pedantic, clippy::restriction)] - edit in common/beancount-pretty-printer/tests/snapshotting.rs at line 9
use beancount_types::Flag::Complete; - edit in common/beancount-pretty-printer/tests/snapshotting.rs at line 12
use beancount_types::TransactionFlag::Complete; - edit in common/beancount-pretty-printer/src/lib.rs at line 1
//! A pretty printer for [`beancount`](https://beancount.github.io) files. - edit in common/beancount-pretty-printer/src/lib.rs at line 13
use core::ops::RangeInclusive; - edit in common/beancount-pretty-printer/src/lib.rs at line 28
use std::ops::RangeInclusive; - edit in common/beancount-pretty-printer/src/lib.rs at line 30
/// Data for pretty printing decimals with english locale.#[allow(clippy::all, clippy::pedantic, unreachable_pub)] - replacement in common/beancount-pretty-printer/src/lib.rs at line 167
pub fn print_directives<'a>(pub fn print_directives<'d>( - replacement in common/beancount-pretty-printer/src/lib.rs at line 169
directives: impl IntoIterator<Item = &'a Directive>,directives: impl IntoIterator<Item = &'d Directive>, - edit in common/beancount-pretty-printer/src/lib.rs at line 284
impl<W> core::fmt::Debug for PrettyPrinter<W> {fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {f.debug_struct("PrettyPrinter").field("config", &self.config).finish_non_exhaustive()}} - edit in common/beancount-pretty-printer/build.rs at line 1
//! Build script - edit in common/beancount-pretty-printer/build.rs at line 6
use icu_decimal::provider::DecimalSymbolsV1Marker; - edit in common/beancount-pretty-printer/build.rs at line 8
use icu_provider::marker::KeyedDataMarker as _; - replacement in common/beancount-pretty-printer/build.rs at line 22
&icu_datagen::keys(&["decimal/symbols@1"]),&[DecimalSymbolsV1Marker::KEY], - edit in common/beancount-pretty-printer/Cargo.toml at line 5
publish.workspace = true - edit in common/beancount-pretty-printer/Cargo.toml at line 38[3.1006]
icu_provider.workspace = true - edit in Cargo.toml at line 26
momo = "*" - edit in Cargo.toml at line 69
publish = false - edit in Cargo.toml at line 72[3.1833]
[profile.release-lto]codegen-units = 1inherits = "release"lto = "thin" - edit in Cargo.lock at line 59
][[package]]name = "ansi_term"version = "0.12.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2"dependencies = ["winapi", - edit in Cargo.lock at line 77
name = "atty"version = "0.2.14"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"dependencies = ["hermit-abi","libc","winapi",][[package]] - edit in Cargo.lock at line 129
[[package]]name = "beancount-importers-framework"version = "0.0.0-dev.0"dependencies = ["beancount-pretty-printer","beancount-tree-writer","camino","clap","clap-verbosity-flag","color-eyre","inventory","ron","serde","tracing","tracing-error","tracing-log","tracing-subscriber","uniondepot",] - replacement in Cargo.lock at line 135
"bstr 1.0.1","bstr", - edit in Cargo.lock at line 177
"momo", - edit in Cargo.lock at line 240[3.2696]→[3.2696:2938](∅→∅),[3.2938]→[4.5088:5103](∅→∅),[4.5088]→[4.5088:5103](∅→∅),[4.5103]→[4.1090:1104](∅→∅),[4.27381]→[4.1090:1104](∅→∅)
version = "0.2.17"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223"dependencies = ["lazy_static","memchr","regex-automata 0.1.10","serde",][[package]]name = "bstr" - edit in Cargo.lock at line 388[3.2984]→[3.2984:3266](∅→∅),[3.3266]→[4.7649:7651](∅→∅),[4.7649]→[4.7649:7651](∅→∅),[4.7651]→[4.6273:6286](∅→∅),[4.27751]→[4.6273:6286](∅→∅),[4.6286]→[3.3267:4012](∅→∅)
name = "clap"version = "4.0.8"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "5840cd9093aabeabf7fd932754c435b7674520fc3ddc935c397837050f0f1e4b"dependencies = ["atty","bitflags","clap_derive","clap_lex","once_cell","strsim","termcolor",][[package]]name = "clap-verbosity-flag"version = "2.0.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "23e2b6c3dcdb73299f48ae05b294da14e2f560b3ed2c09e742269eb1b22af231"dependencies = ["clap","log",][[package]]name = "clap_derive"version = "4.0.8"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "92289ffc6fb4a85d85c246ddb874c05a87a2e540fb6ad52f7ca07c8c1e1840b1"dependencies = ["heck","proc-macro-error","proc-macro2","quote","syn",][[package]]name = "clap_lex"version = "0.3.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "0d4198f73e42b4936b35b5bb248d81d2b595ecb170da0bac7655c54eedfa8da8"dependencies = ["os_str_bytes",][[package]] - edit in Cargo.lock at line 576[3.4226]→[3.4226:4702](∅→∅),[3.4702]→[4.10501:10516](∅→∅),[4.10501]→[4.10501:10516](∅→∅),[4.10516]→[3.4703:4929](∅→∅)
name = "csv"version = "1.1.6"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "22813a6dc45b335f9bade10bf7271dc477e81113e89eb251a0bc2a8a81c536e1"dependencies = ["bstr 0.2.17","csv-core","itoa 0.4.8","ryu","serde",][[package]]name = "csv-core"version = "0.1.10"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90"dependencies = ["memchr",][[package]]name = "ctor"version = "0.1.23"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "cdffe87e1d521a10f9696f833fe502293ea446d7f256c06128293a4119bdf4cb"dependencies = ["quote","syn",][[package]] - replacement in Cargo.lock at line 577
version = "0.13.4"version = "0.14.1" - replacement in Cargo.lock at line 579
checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c"checksum = "4529658bdda7fd6769b8614be250cdcfc3aeb0ee72fe66f9e41e5e5eb73eac02" - replacement in Cargo.lock at line 587
version = "0.13.4"version = "0.14.1" - replacement in Cargo.lock at line 589
checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610"checksum = "649c91bc01e8b1eac09fb91e8dbc7d517684ca6be8ebc75bb9cafc894f9fdb6f" - replacement in Cargo.lock at line 600
version = "0.13.4"version = "0.14.1" - replacement in Cargo.lock at line 602
checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835"checksum = "ddfc69c5bfcbd2fc09a0f38451d2daf0e372e367986a83906d1b0dbc88134fb5" - replacement in Cargo.lock at line 804
version = "1.0.11"version = "1.0.12" - replacement in Cargo.lock at line 806
checksum = "4799cdb24d48f1f8a7a98d06b7fde65a85a2d1e42b25a889f5406aa1fbefe074"checksum = "19be8061a06ab6f3a6cf21106c873578bf01bd42ad15e0311a9c76161cb1c753" - replacement in Cargo.lock at line 813
version = "0.6.0"version = "0.6.1" - replacement in Cargo.lock at line 815
checksum = "ea83a3fbdc1d999ccfbcbee717eab36f8edf2d71693a23ce0d7cca19e085304c"checksum = "03e7b551eba279bf0fa88b83a46330168c1560a52a94f5126f892f0b364ab3e0" - edit in Cargo.lock at line 1019
name = "ghost"version = "0.1.6"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "eb19fe8de3ea0920d282f7b77dd4227aea6b8b999b42cdf0ca41b2472b14443a"dependencies = ["proc-macro2","quote","syn",][[package]] - replacement in Cargo.lock at line 1127
"itoa 1.0.3","itoa", - replacement in Cargo.lock at line 1168
"itoa 1.0.3","itoa", - edit in Cargo.lock at line 1613[4.30160]→[4.30014:30016](∅→∅),[4.30014]→[4.30014:30016](∅→∅),[4.30016]→[4.30161:30174](∅→∅),[4.30174]→[3.5219:5435](∅→∅)
][[package]]name = "inventory"version = "0.3.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "30a61b8101d87996f82d725ba701b1987b7afc72f481c13513a30b855b9c9133"dependencies = ["ctor","ghost", - edit in Cargo.lock at line 1629
[[package]]name = "itoa"version = "0.4.8"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" - edit in Cargo.lock at line 1767
][[package]]name = "matchers"version = "0.1.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558"dependencies = ["regex-automata 0.1.10", - edit in Cargo.lock at line 1821
name = "momo"version = "0.2.2"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "67f9e707519a058a29a09bda9ce6ed266803c0a6ad9381a9eaae3fb5d83b696b"dependencies = ["watt",][[package]] - edit in Cargo.lock at line 1991
name = "os_str_bytes"version = "6.3.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "9ff7415e9ae3fff1225851df9e0d9e4e5479f947619774677a63572e55e80eff"[[package]] - edit in Cargo.lock at line 2271
dependencies = ["regex-syntax",] - edit in Cargo.lock at line 2402
name = "ron"version = "0.8.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "300a51053b1cb55c80b7a9fde4120726ddf25ca241a1cbb926626f62fb136bff"dependencies = ["base64","bitflags","serde",][[package]] - replacement in Cargo.lock at line 2598
"itoa 1.0.3","itoa", - replacement in Cargo.lock at line 2610
"itoa 1.0.3","itoa", - replacement in Cargo.lock at line 2678
version = "1.9.0"version = "1.10.0" - replacement in Cargo.lock at line 2680
checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1"checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" - edit in Cargo.lock at line 2797
name = "strsim"version = "0.10.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"[[package]] - edit in Cargo.lock at line 2857
name = "termcolor"version = "1.1.3"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755"dependencies = ["winapi-util",][[package]] - replacement in Cargo.lock at line 2955
"itoa 1.0.3","itoa", - edit in Cargo.lock at line 3118
name = "tracing-log"version = "0.1.3"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922"dependencies = ["lazy_static","log","tracing-core",][[package]] - edit in Cargo.lock at line 3123
"ansi_term","matchers","once_cell","regex", - edit in Cargo.lock at line 3124
"smallvec", - edit in Cargo.lock at line 3125
"tracing", - edit in Cargo.lock at line 3126
"tracing-log", - edit in Cargo.lock at line 3172
[[package]]name = "uniondepot"version = "0.0.0-dev.0"dependencies = ["beancount-types","color-eyre","csv","german-decimal","inventory","once_cell","time 0.3.14",] - edit in Cargo.lock at line 3607
[[package]]name = "watt"version = "0.4.2"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "6dfc297c23899ed07d6ea3e6ed6c91f63ee6fc67aefb28243d5a610ead995fe0" - edit in Cargo.lock at line 3652
name = "winapi-util"version = "0.1.5"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"dependencies = ["winapi",][[package]]