pub mod git;
use {Source, Error};
use std::path::Path;
pub trait Backend {
fn update(&mut self, verbose: bool) -> Result<(), Error>;
}
pub fn setup<S>(dest: &Path, source: S) -> Result<Box<dyn Backend>, Error>
where S: Into<Source> {
match source.into() {
Source::Git { ref url } => git::Git::setup(dest, url).map(|b| Box::new(b) as _),
}
}
pub fn open<S>(path: &Path, source: S) -> Result<Box<dyn Backend>, Error>
where S: Into<Source> {
match source.into() {
Source::Git { .. } => git::Git::open(path).map(|b| Box::new(b) as _),
}
}