From 6202311aa76ff9c40786bce672a1137b34195bc6 Mon Sep 17 00:00:00 2001 From: Antoine Gersant Date: Sat, 1 Jul 2017 12:49:58 -0700 Subject: [PATCH] Removed locate from DB struct --- src/api.rs | 4 +++- src/db/mod.rs | 5 ----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/api.rs b/src/api.rs index 4bf2411..50f641b 100644 --- a/src/api.rs +++ b/src/api.rs @@ -20,6 +20,7 @@ use errors::*; use thumbnails::*; use user; use utils::*; +use vfs::VFSSource; const CURRENT_MAJOR_VERSION: i32 = 2; const CURRENT_MINOR_VERSION: i32 = 0; @@ -265,7 +266,8 @@ fn serve(request: &mut Request, db: &DB) -> IronResult { Ok(p) => p, }; - let real_path = db.locate(virtual_path.as_path()); + let vfs = db.get_vfs()?; + let real_path = vfs.virtual_to_real(&virtual_path); let real_path = match real_path { Err(e) => return Err(IronError::new(e, status::NotFound)), Ok(p) => p, diff --git a/src/db/mod.rs b/src/db/mod.rs index e334457..ac5586f 100644 --- a/src/db/mod.rs +++ b/src/db/mod.rs @@ -114,11 +114,6 @@ impl DB { Ok(misc.auth_secret.to_owned()) } - pub fn locate(&self, virtual_path: &Path) -> Result { - let vfs = self.get_vfs()?; - vfs.virtual_to_real(virtual_path) - } - pub fn index_update(&self) -> Result<()> { index::update(self) }