Fix clippy warnings in beancount-types

korrat
Mar 19, 2024, 4:58 PM
YKZNTEVOV64AWTCZSKGGSSYEEJMD2KHX4RMFQ72ORSE4SMH6GWGAC

Dependencies

  • [2] R524JUUE Implement metadata & price directives
  • [3] YBARPI2B Make account templates owned
  • [4] W3MWSSJ7 Add a templating engine for accounts

Change contents

  • replacement in common/beancount-types/src/metadata/link.rs at line 57
    [2.2902][2.2902:2928]()
    type Err = LinkError;
    [2.2902]
    [2.2928]
    type Err = Error;
  • replacement in common/beancount-types/src/metadata/link.rs at line 66
    [2.3088][2.3088:3116]()
    type Error = LinkError;
    [2.3088]
    [2.3116]
    type Error = Error;
  • replacement in common/beancount-types/src/metadata/link.rs at line 70
    [2.3192][2.3192:3256]()
    ensure!(is_valid_link_name(&name), LinkSnafu { name });
    [2.3192]
    [2.3256]
    ensure!(is_valid_link_name(&name), Snafu { name });
  • replacement in common/beancount-types/src/metadata/link.rs at line 77
    [2.3328][2.3328:3351]()
    pub struct LinkError {
    [2.3328]
    [2.3351]
    pub struct Error {
  • replacement in common/beancount-types/src/metadata/link.rs at line 111
    [2.3991][2.3991:4019]()
    type Error = LinkError;
    [2.3991]
    [2.4019]
    type Error = Error;
  • replacement in common/beancount-types/src/metadata/link.rs at line 115
    [2.4096][2.4096:4159]()
    ensure!(is_valid_link_name(name), LinkSnafu { name });
    [2.4096]
    [2.4159]
    ensure!(is_valid_link_name(name), Snafu { name });
  • edit in common/beancount-types/src/metadata/kv.rs at line 27
    [2.4956]
    [2.4956]
    /// Create a new `Key` from a [`String`] without checking the format.
    ///
    /// # Safety
    ///
    /// This function assumes that the given name is a valid `Key`.
  • edit in common/beancount-types/src/metadata/kv.rs at line 116
    [2.6493]
    [2.6493]
    /// Create a new `Ky` from a [`str`] without checking the format.
    ///
    /// # Safety
    ///
    /// This function assumes that the given name is a valid `Ky`.
  • edit in common/beancount-types/src/account/template.rs at line 81
    [3.11231]
    [3.1019]
    /// Parse a [`str`] into a template.
    ///
    /// # Errors
    ///
    /// This function will return an error if the given `str` is not a valid template.
    /// This happens, when
    ///
    /// * the template does not start with a valid base account;
    /// * the template uses an unknown selector.
  • replacement in common/beancount-types/src/account/template.rs at line 165
    [3.13051][3.1741:1777]()
    pub(crate) enum Segment<Selector> {
    [3.13051]
    [3.1777]
    enum Segment<Selector> {
  • edit in common/beancount-types/src/account/template.rs at line 219
    [3.14535]
    [3.14535]
    #[allow(clippy::manual_try_fold, /* reason = "we want to collect multiple errors here" */)]