Skip to content

Commit

Permalink
refactor(syntax):♻️ reduce match statement into an if-let statement
Browse files Browse the repository at this point in the history
`match` statements with only one useful arm can be reduced to an `if let` statement.
This helps improve readability, an `if let` statement nests lesser than a `match`.

Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
  • Loading branch information
deepsource-autofix[bot] authored Feb 10, 2024
1 parent 6928a55 commit da350d8
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,9 @@ impl Server {
session_handle: Handle,
client_id: (usize, ChannelId),
) {
match process {
StartExecResults::Attached { input, output } => {
self.link_io(channel, session_handle, client_id, input, output)
.await;
}
_ => {}
if let StartExecResults::Attached { input, output } = process {
self.link_io(channel, session_handle, client_id, input, output)
.await;
};
}

Expand Down

0 comments on commit da350d8

Please sign in to comment.