Skip to content

Commit 6973cbc

Browse files
committed
apply clippy fixes
1 parent 6df87dc commit 6973cbc

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

src/rpki/cloudflare.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,7 @@ impl RpkiTrie {
102102
for roa in data.roas {
103103
let prefix = roa.prefix.parse::<IpNet>()?;
104104
let max_length = roa.max_length;
105-
let rir = match Rir::from_str(roa.ta.as_str()) {
106-
Ok(rir) => Some(rir),
107-
Err(_) => None,
108-
};
105+
let rir = Rir::from_str(roa.ta.as_str()).ok();
109106
let roa_entry = RoaEntry {
110107
prefix,
111108
asn: roa.asn,

src/rpki/ripe_historical.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,9 @@ impl RpkiTrie {
5353
Err(_) => continue,
5454
};
5555
let not_before =
56-
match NaiveDateTime::parse_from_str(fields.next().unwrap(), "%Y-%m-%d %H:%M:%S") {
57-
Ok(t) => Some(t),
58-
Err(_) => None,
59-
};
56+
NaiveDateTime::parse_from_str(fields.next().unwrap(), "%Y-%m-%d %H:%M:%S").ok();
6057
let not_after =
61-
match NaiveDateTime::parse_from_str(fields.next().unwrap(), "%Y-%m-%d %H:%M:%S") {
62-
Ok(t) => Some(t),
63-
Err(_) => None,
64-
};
58+
NaiveDateTime::parse_from_str(fields.next().unwrap(), "%Y-%m-%d %H:%M:%S").ok();
6559
let roa_entry = RoaEntry {
6660
prefix,
6761
asn,

0 commit comments

Comments
 (0)