summaryrefslogtreecommitdiffstats
path: root/ui/src/components/mail/listing.rs
diff options
context:
space:
mode:
authorManos Pitsidianakis <el13635@mail.ntua.gr>2019-11-18 22:20:18 +0200
committerManos Pitsidianakis <el13635@mail.ntua.gr>2019-11-18 22:20:18 +0200
commitf1588f6002c43f1e602699baa724a474768cce2c (patch)
tree255e0c3ec638d459f8a0d25df0d6725b3aa58fc4 /ui/src/components/mail/listing.rs
parent8798d84e435ffebdc0acf9c6d9b94e49414c0230 (diff)
ui: shortcuts refactoring
Diffstat (limited to 'ui/src/components/mail/listing.rs')
-rw-r--r--ui/src/components/mail/listing.rs16
1 files changed, 5 insertions, 11 deletions
diff --git a/ui/src/components/mail/listing.rs b/ui/src/components/mail/listing.rs
index 53e24e00..8b4c3471 100644
--- a/ui/src/components/mail/listing.rs
+++ b/ui/src/components/mail/listing.rs
@@ -508,7 +508,7 @@ impl Component for Listing {
self.component.set_movement(PageMovement::Down(amount));
return true;
}
- UIEvent::Input(ref key) if *key == shortcuts["prev_page"] => {
+ UIEvent::Input(ref key) if key == shortcuts["prev_page"] => {
let mult = if self.cmd_buf.is_empty() {
1
} else if let Ok(mult) = self.cmd_buf.parse::<usize>() {
@@ -527,7 +527,7 @@ impl Component for Listing {
self.component.set_movement(PageMovement::PageUp(mult));
return true;
}
- UIEvent::Input(ref key) if *key == shortcuts["next_page"] => {
+ UIEvent::Input(ref key) if key == shortcuts["next_page"] => {
let mult = if self.cmd_buf.is_empty() {
1
} else if let Ok(mult) = self.cmd_buf.parse::<usize>() {
@@ -564,7 +564,7 @@ impl Component for Listing {
.push_back(UIEvent::Action(Tab(NewDraft(self.cursor_pos.0, None))));
return true;
}
- UIEvent::Input(ref key) if *key == shortcuts["search"] => {
+ UIEvent::Input(ref key) if key == shortcuts["search"] => {
context
.replies
.push_back(UIEvent::ExInput(Key::Paste("filter ".to_string())));
@@ -573,7 +573,7 @@ impl Component for Listing {
.push_back(UIEvent::ChangeMode(UIMode::Execute));
return true;
}
- UIEvent::Input(ref key) if *key == shortcuts["set_seen"] => {
+ UIEvent::Input(ref key) if key == shortcuts["set_seen"] => {
let mut event = UIEvent::Action(Action::Listing(ListingAction::SetSeen));
if match self.component {
Plain(ref mut l) => l.process_event(&mut event, context),
@@ -647,13 +647,7 @@ impl Component for Listing {
Conversations(ref l) => l.get_shortcuts(context),
};
let config_map = context.settings.shortcuts.listing.key_values();
- map.insert(
- Listing::DESCRIPTION.to_string(),
- config_map
- .into_iter()
- .map(|(k, v)| (k, v.clone()))
- .collect(),
- );
+ map.insert(Listing::DESCRIPTION, config_map);
map
}