diff --git a/src/lib.rs b/src/lib.rs index 2e13ae1..8338feb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -146,9 +146,7 @@ impl MenuState { /// /// down highlights "sub item 2" pub fn down(&mut self) { - if self.active_depth() == 0 { - // do nothing - } else if self.active_depth() == 1 { + if self.active_depth() == 1 { self.push(); } else { self.next(); @@ -213,7 +211,9 @@ impl MenuState { /// right pushes "sub sub item 2". this differs from case 2 that /// current highlighted item can be expanded pub fn right(&mut self) { - if self.active_depth() == 1 { + if self.active_depth() == 0 { + // do nothing + } else if self.active_depth() == 1 { self.next(); } else if self.active_depth() == 2 { if self.push().is_none() {