Resolve "Local collection trait and beets implementation" #9
@ -8,6 +8,10 @@ trait QueryOptionArgBeets {
|
||||
fn to_arg(&self, option_name: &str) -> Option<String>;
|
||||
}
|
||||
|
||||
trait QueryArgsBeets {
|
||||
fn to_args(&self) -> Vec<String>;
|
||||
}
|
||||
|
||||
trait SimpleOption {}
|
||||
impl SimpleOption for String {}
|
||||
impl SimpleOption for u32 {}
|
||||
@ -34,10 +38,6 @@ impl QueryOptionArgBeets for QueryOption<Vec<String>> {
|
||||
}
|
||||
}
|
||||
|
||||
trait QueryArgsBeets {
|
||||
fn to_args(&self) -> Vec<String>;
|
||||
}
|
||||
|
||||
impl QueryArgsBeets for Query {
|
||||
fn to_args(&self) -> Vec<String> {
|
||||
let mut arguments: Vec<String> = vec![];
|
||||
@ -78,12 +78,6 @@ pub struct Beets {
|
||||
executor: Box<dyn BeetsExecutor>,
|
||||
}
|
||||
|
||||
impl Beets {
|
||||
pub fn new(executor: Box<dyn BeetsExecutor>) -> Beets {
|
||||
Beets { executor }
|
||||
}
|
||||
}
|
||||
|
||||
trait LibraryPrivate {
|
||||
const CMD_LIST: &'static str;
|
||||
const LIST_FORMAT_SEPARATOR: &'static str;
|
||||
@ -93,6 +87,12 @@ trait LibraryPrivate {
|
||||
fn list_to_albums(list_output: Vec<String>) -> Result<Vec<Album>, Error>;
|
||||
}
|
||||
|
||||
impl Beets {
|
||||
pub fn new(executor: Box<dyn BeetsExecutor>) -> Beets {
|
||||
Beets { executor }
|
||||
}
|
||||
}
|
||||
|
||||
impl Library for Beets {
|
||||
fn list(&mut self, query: &Query) -> Result<Vec<Album>, Error> {
|
||||
let cmd = Self::list_cmd_and_args(query);
|
||||
|
Loading…
Reference in New Issue
Block a user