Refactor: Outsource filepath building

This commit is contained in:
Matthias Beyer 2015-11-24 10:30:52 +01:00
parent f498ffa54c
commit 14ae6d623b

View file

@ -67,7 +67,7 @@ impl StorageBackend {
{
let written = p.write(f.contents());
if let Ok(string) = written {
let path = self.basepath + &f.id()[..];
let path = self.build_filepath(&f);
debug!("Writing file: {}", path);
Ok(Ok(()))
} else {
@ -92,6 +92,10 @@ impl StorageBackend {
pub fn get_file_by_id(id: FileID) -> Option<File> {
}
fn build_filepath(&self, f: &File) -> String {
self.basepath + &f.id()[..]
}
}
#[derive(Debug)]