Skip to content

Commit

Permalink
Clippy: run on stable also; don't enforce (most) errors on nightly; f…
Browse files Browse the repository at this point in the history
…ixes
  • Loading branch information
dhardy committed Jan 10, 2022
1 parent 2d8e68f commit 50cc135
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
- name: Test examples/mandlebrot
run: cargo test --manifest-path examples/mandlebrot/Cargo.toml --all-features
- name: Clippy
run: cargo +nightly clippy --all --features nightly -- -D warnings
run: cargo clippy --all --features nightly

test:
name: Test
Expand All @@ -72,6 +72,7 @@ jobs:
profile: minimal
toolchain: ${{ matrix.toolchain }}
override: true
components: clippy
- name: Install dependencies
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get install -y libxkbcommon-dev libxcb-shape0-dev libxcb-xfixes0-dev
Expand All @@ -94,3 +95,6 @@ jobs:
run: cargo test
- name: Test examples/mandlebrot
run: cargo test --manifest-path examples/mandlebrot/Cargo.toml
- name: Clippy (stable)
if: matrix.os == 'macos-latest'
run: cargo clippy --all -- -D warnings -A unknown_lints
12 changes: 5 additions & 7 deletions crates/kas-widgets/src/menu/menubar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,11 @@ widget! {
// but delay when over a sub-menu (most intuitive?)
if self.rect().contains(coord) && !self.bar.eq_id(&id) {
self.set_menu_path(mgr, Some(&id), false);
} else {
if id != self.delayed_open {
mgr.set_nav_focus(id.clone(), false);
let delay = mgr.config().menu_delay();
mgr.update_on_timer(delay, self.id(), id.as_u64());
self.delayed_open = Some(id);
}
} else if id != self.delayed_open {
mgr.set_nav_focus(id.clone(), false);
let delay = mgr.config().menu_delay();
mgr.update_on_timer(delay, self.id(), id.as_u64());
self.delayed_open = Some(id);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/kas-widgets/src/menu/submenu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ widget! {
fn set_menu_path(&mut self, mgr: &mut EventMgr, target: Option<&WidgetId>, set_focus: bool) {
match target {
Some(id) if self.is_ancestor_of(id) => {
if !self.popup_id.is_some() {
if self.popup_id.is_none() {
self.open_menu(mgr, set_focus);
}
if !self.eq_id(id) {
Expand Down

0 comments on commit 50cc135

Please sign in to comment.