aboutsummaryrefslogtreecommitdiff
path: root/src/config.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/config.rs b/src/config.rs
index 6aa6d10..329f7a6 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -30,21 +30,21 @@ pub struct RawConfig {
fn config_otp_slot_to_option(value: u8) -> Option<u8> {
if value < 3 {
- return Some(value);
+ Some(value)
+ } else {
+ None
}
- None
}
fn option_to_config_otp_slot(value: Option<u8>) -> Result<u8, Error> {
- match value {
- Some(value) => {
- if value < 3 {
- Ok(value)
- } else {
- Err(LibraryError::InvalidSlot.into())
- }
+ if let Some(value) = value {
+ if value < 3 {
+ Ok(value)
+ } else {
+ Err(LibraryError::InvalidSlot.into())
}
- None => Ok(255),
+ } else {
+ Ok(255)
}
}