Remove versions viewer

This commit is contained in:
Matthias Beyer 2016-08-28 19:07:33 +02:00
parent 82f08c6021
commit 7487c630f2
2 changed files with 0 additions and 57 deletions

View file

@ -1,4 +1,3 @@
pub mod editor;
pub mod plain;
pub mod stdout;
pub mod versions;

View file

@ -1,56 +0,0 @@
use libimagstore::store::Entry;
use libimagstore::store::Store;
use libimagerror::into::IntoError;
use viewer::Viewer;
use result::Result;
use error::ViewErrorKind as VEK;
use error::MapErrInto;
pub struct VersionsViewer<'a> {
store: &'a Store,
}
impl<'a> VersionsViewer<'a> {
pub fn new(store: &'a Store) -> VersionsViewer<'a> {
VersionsViewer {
store: store,
}
}
}
impl<'a> Viewer for VersionsViewer<'a> {
fn view_entry(&self, entr: &Entry) -> Result<()> {
use glob::glob;
entr.get_location()
.clone()
.with_base(self.store.path().clone())
.to_str()
.map_err_into(VEK::ViewError)
.and_then(|s| {
s.split("~")
.next()
.ok_or(VEK::PatternError.into_error())
.map(|s| format!("{}~*", s))
.and_then(|pat| glob(&pat[..]).map_err(|_| VEK::PatternError.into_error()))
.and_then(|paths| {
for entry in paths {
println!("{}",
try!(entry
.map_err(|_| VEK::GlobError.into_error()))
.file_name()
.and_then(|s| s.to_str())
.unwrap() // TODO
);
};
Ok(())
})
})
}
}