Update the dependency manager file stack when rendering blog post pages.
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
use std::path::PathBuf;
|
||||
|
||||
use crate::error::CustomError;
|
||||
|
||||
pub(crate) type RefDependencyManager = std::sync::Arc<std::sync::Mutex<DependencyManager>>;
|
||||
|
||||
#[derive(Debug)]
|
||||
@@ -16,4 +18,19 @@ impl DependencyManager {
|
||||
file_stack: Vec::new(),
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn push_file<P>(&mut self, path: P) -> Result<(), CustomError>
|
||||
where
|
||||
P: Into<PathBuf>,
|
||||
{
|
||||
self.file_stack.push(path.into());
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub(crate) fn pop_file(&mut self) -> Result<(), CustomError> {
|
||||
self.file_stack
|
||||
.pop()
|
||||
.expect("Popped more files off the dependency manager file stack than exist.");
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user