Skip to content

Commit

Permalink
remove unnecessary unwrap
Browse files Browse the repository at this point in the history
  • Loading branch information
gjcolombo committed Jun 5, 2024
1 parent 792645b commit 999afb0
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions nexus/src/app/sagas/instance_common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,15 +287,13 @@ pub async fn instance_ip_get_instance_state(
// block the attach/detach.
(
InstanceState::Vmm,
Some(VmmState::Starting)
| Some(VmmState::Migrating)
| Some(VmmState::Stopping)
| Some(VmmState::Stopped),
Some(state @ VmmState::Starting)
| Some(state @ VmmState::Migrating)
| Some(state @ VmmState::Stopping)
| Some(state @ VmmState::Stopped),
) => {
// Unwrapping is safe since all the matched VMM states are Some.
let found_vmm_state = found_vmm_state.unwrap();
return Err(ActionError::action_failed(Error::unavail(&format!(
"can't {verb} in transient state {found_vmm_state}"
"can't {verb} in transient state {state}"
))));
}
(InstanceState::Destroyed, _) => {
Expand Down

0 comments on commit 999afb0

Please sign in to comment.