Make clippy happy

timeout_old
Tassilo Horn 3 years ago
parent 2702a69925
commit 0bd68b6342
  1. 16
      Cargo.lock
  2. 17
      src/cmds.rs

16
Cargo.lock generated

@ -42,9 +42,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "clap"
version = "3.1.5"
version = "3.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ced1892c55c910c1219e98d6fc8d71f6bddba7905866ce740066d8bfea859312"
checksum = "d8c93436c21e4698bacadf42917db28b23017027a4deccb35dbe47a7e7840123"
dependencies = [
"atty",
"bitflags",
@ -165,9 +165,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
[[package]]
name = "libc"
version = "0.2.119"
version = "0.2.120"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1bf2e165bb3457c8e098ea76f3e3bc9db55f87aa90d52d0e6be741470916aaa4"
checksum = "ad5c14e80759d0939d013e6ca49930e59fc53dd8e5009132f76240c179380c09"
[[package]]
name = "log"
@ -292,9 +292,9 @@ dependencies = [
[[package]]
name = "regex"
version = "1.5.4"
version = "1.5.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461"
checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286"
dependencies = [
"aho-corasick",
"memchr",
@ -402,9 +402,9 @@ dependencies = [
[[package]]
name = "syn"
version = "1.0.86"
version = "1.0.88"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a65b3f4ffa0092e9887669db0eae07941f023991ab58ea44da8fe8e2d511c6b"
checksum = "ebd69e719f31e88618baa1eaa6ee2de5c9a1c004f1e9ecdb58e8352a13f20a01"
dependencies = [
"proc-macro2",
"quote",

@ -499,14 +499,17 @@ pub fn switch_to_app_or_urgent_or_lru_window(
let wins = tree.get_windows();
let app_win =
name.and_then(|n| wins.iter().find(|w| w.node.get_app_name() == n));
if app_win.is_none() || app_win.unwrap().node.is_current() {
if let Some(win) = wins.get(0) {
focus_window_by_id(win.node.id)
} else {
log::debug!("No window to switch to.")
match app_win {
Some(app_win) if !app_win.node.is_current() => {
focus_window_by_id(app_win.node.id)
}
_ => {
if let Some(win) = wins.get(0) {
focus_window_by_id(win.node.id)
} else {
log::debug!("No window to switch to.")
}
}
} else {
focus_window_by_id(app_win.unwrap().node.id)
}
}

Loading…
Cancel
Save