Move to enum-based commands

This commit is contained in:
Rasmus Larsen
2019-05-20 22:15:12 +02:00
parent 4b4a027c3c
commit 1671db14c1
15 changed files with 343 additions and 317 deletions

View File

@@ -3,6 +3,7 @@ use std::sync::Arc;
use cursive::view::ViewWrapper;
use cursive::Cursive;
use command::Command;
use commands::CommandResult;
use library::Library;
use queue::Queue;
@@ -48,12 +49,7 @@ impl ViewWrapper for LibraryView {
}
impl ViewExt for LibraryView {
fn on_command(
&mut self,
s: &mut Cursive,
cmd: &str,
args: &[String],
) -> Result<CommandResult, String> {
self.tabs.on_command(s, cmd, args)
fn on_command(&mut self, s: &mut Cursive, cmd: &Command) -> Result<CommandResult, String> {
self.tabs.on_command(s, cmd)
}
}