Skip to content

Commit

Permalink
replace single with exactly_one
Browse files Browse the repository at this point in the history
  • Loading branch information
j2ghz committed Dec 28, 2020
1 parent 6bc659d commit 10a54cd
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 104 deletions.
101 changes: 0 additions & 101 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ itertools = "0.10"
nom = "6.0"
num = "0.3"
rayon = "1.5"
single = "1"

[dev-dependencies.cargo-husky]
features = ["run-cargo-fmt"]
Expand Down
3 changes: 1 addition & 2 deletions src/day16.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use nom::{
sequence::{preceded, separated_pair, tuple},
Finish,
};
use single::Single;
use std::ops::RangeInclusive;

#[derive(Debug)]
Expand Down Expand Up @@ -75,7 +74,7 @@ impl Scan {
.iter()
.filter(|fv| field_values_match_rules(fv, &f.rules))
.map(|fv| fv.my_ticket)
.single()
.exactly_one()
.map_err(|e| anyhow!("{}", e))
.with_context(|| {
format!("None of values matched the rules: {:?}", f.rules)
Expand Down

0 comments on commit 10a54cd

Please sign in to comment.