diff --git a/src/library/beets.rs b/src/library/beets.rs index 26aab1c..d45599d 100644 --- a/src/library/beets.rs +++ b/src/library/beets.rs @@ -78,32 +78,6 @@ pub struct Beets { executor: Box, } -pub struct SystemExecutor { - bin: String, -} - -impl SystemExecutor { - pub fn new(bin: &str) -> SystemExecutor { - SystemExecutor { - bin: bin.to_string(), - } - } -} - -impl Default for SystemExecutor { - fn default() -> Self { - SystemExecutor::new("beet") - } -} - -impl BeetsExecutor for SystemExecutor { - fn exec(&mut self, arguments: Vec) -> Result, Error> { - let output = Command::new(&self.bin).args(arguments).output()?; - let output = std::str::from_utf8(&output.stdout)?; - Ok(output.split('\n').map(|s| s.to_string()).collect()) - } -} - #[derive(Debug, Hash, Eq, PartialEq)] struct AlbumId { artist: String, @@ -206,6 +180,32 @@ impl Library for Beets { } } +pub struct SystemExecutor { + bin: String, +} + +impl SystemExecutor { + pub fn new(bin: &str) -> SystemExecutor { + SystemExecutor { + bin: bin.to_string(), + } + } +} + +impl Default for SystemExecutor { + fn default() -> Self { + SystemExecutor::new("beet") + } +} + +impl BeetsExecutor for SystemExecutor { + fn exec(&mut self, arguments: Vec) -> Result, Error> { + let output = Command::new(&self.bin).args(arguments).output()?; + let output = std::str::from_utf8(&output.stdout)?; + Ok(output.split('\n').map(|s| s.to_string()).collect()) + } +} + #[cfg(test)] mod tests { use super::*;