mirror of
https://github.com/agersant/polaris
synced 2024-12-03 10:09:09 +00:00
Removed locate from DB struct
This commit is contained in:
parent
d9532dd22c
commit
6202311aa7
2 changed files with 3 additions and 6 deletions
|
@ -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<Response> {
|
|||
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,
|
||||
|
|
|
@ -114,11 +114,6 @@ impl DB {
|
|||
Ok(misc.auth_secret.to_owned())
|
||||
}
|
||||
|
||||
pub fn locate(&self, virtual_path: &Path) -> Result<PathBuf> {
|
||||
let vfs = self.get_vfs()?;
|
||||
vfs.virtual_to_real(virtual_path)
|
||||
}
|
||||
|
||||
pub fn index_update(&self) -> Result<()> {
|
||||
index::update(self)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue