Skip to content

Commit

Permalink
Revert "start implementing PartialOrd for Directive"
Browse files Browse the repository at this point in the history
This reverts commit d220cec.
  • Loading branch information
jcornaz committed Jul 9, 2023
1 parent d220cec commit 6db30d3
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 24 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
* Support booking method in open account directive
* implement `std::error::Error` for `ConversionError`
* implement `FromStr` for `Directive<D>` where `D: Decimal`
* implement `PartialOrd` for `Directive<D>`


## [2.0.0-beta.2] - 2023-07-08
Expand Down
10 changes: 0 additions & 10 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
//! # Ok(()) }
//! ```

use std::cmp::Ordering;
use std::{collections::HashSet, fs::File, io::Read, path::PathBuf, str::FromStr};

use nom::{
Expand Down Expand Up @@ -293,15 +292,6 @@ impl<D: Decimal> FromStr for Directive<D> {
}
}

impl<D> PartialOrd for Directive<D>
where
Directive<D>: PartialEq,
{
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
Some(self.date.cmp(&other.date))
}
}

/// Directive specific content
#[allow(missing_docs)]
#[derive(Debug, Clone, PartialEq)]
Expand Down
13 changes: 0 additions & 13 deletions tests/util_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,3 @@ fn directive_from_str(
let from_str: Directive<f64> = input.parse().unwrap();
assert_eq!(from_file, from_str);
}

#[rstest]
#[case("2023-07-09 open Assets:Cash", "2023-07-10 open Assets:Cash")]
#[case("2023-07-09 open Assets:Cash", "2023-08-08 open Assets:Cash")]
#[case("2023-07-09 open Assets:Cash", "2024-06-08 open Assets:Cash")]
fn directive_ord(#[case] smaller: Directive<f64>, #[case] bigger: Directive<f64>) {
assert!(smaller < bigger);
assert!(smaller <= bigger);
assert_eq!(smaller, smaller.clone());
assert_eq!(bigger, bigger.clone());
assert!(bigger > smaller);
assert!(bigger >= smaller);
}

0 comments on commit 6db30d3

Please sign in to comment.