Skip to content

Commit

Permalink
minor: inverse if so Err is on top
Browse files Browse the repository at this point in the history
  • Loading branch information
vbauerster committed Oct 24, 2024
1 parent e5f192f commit b683096
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/kamp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ pub(super) fn run() -> Result<()> {
let mut output = std::io::stdout();

let Some(command) = kamp.subcommand else {
return if session.is_some() {
return if session.is_none() {
Err(Error::InvalidContext("session is required"))
} else {
[session, client]
.into_iter()
.zip(["session", "client"])
Expand All @@ -48,8 +50,6 @@ pub(super) fn run() -> Result<()> {
None => Ok(()),
})
.map_err(|e| e.into())
} else {
Err(Error::InvalidContext("session is required"))
};
};

Expand Down

0 comments on commit b683096

Please sign in to comment.