Skip to content

Commit

Permalink
refactor: use Option::transpose
Browse files Browse the repository at this point in the history
  • Loading branch information
desbma committed Nov 20, 2024
1 parent c129e2a commit 86ae9af
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ impl FromStr for HwmonSettings {
let start = tokens
.next()
.map(str::parse)
.map_or(Ok(None), |v| v.map(Some))
.transpose()
.map_err(|_| "Invalid min speed temp value")?;
let end = tokens
.next()
.map(str::parse)
.map_or(Ok(None), |v| v.map(Some))
.transpose()
.map_err(|_| "Invalid max speed temp value")?;
Ok(Self {
filepath,
Expand Down

0 comments on commit 86ae9af

Please sign in to comment.