collapse nested 'match' statement
This commit is contained in:
parent
6f48241613
commit
4db31e32e3
1 changed files with 2 additions and 4 deletions
|
|
@ -373,15 +373,13 @@ impl cosmic::Application for CosmicNetworkApplet {
|
|||
}
|
||||
Message::Disconnect(ssid) => {
|
||||
let tx = if let Some(tx) = self.nm_sender.as_ref() {
|
||||
if let Some(ap) = self
|
||||
if let Some(ActiveConnectionInfo::WiFi { state, .. }) = self
|
||||
.nm_state
|
||||
.active_conns
|
||||
.iter_mut()
|
||||
.find(|c| c.name() == ssid)
|
||||
{
|
||||
if let ActiveConnectionInfo::WiFi { state, .. } = ap {
|
||||
*state = ActiveConnectionState::Deactivating;
|
||||
}
|
||||
*state = ActiveConnectionState::Deactivating;
|
||||
}
|
||||
tx
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue