Thread InstanceSnapshotContext through all SnapshotMiddleware

This commit is contained in:
Lucien Greathouse
2019-10-10 11:44:33 -07:00
parent 6d38a785ed
commit f0cd4333c3
12 changed files with 131 additions and 52 deletions

View File

@@ -23,6 +23,7 @@ pub use self::error::*;
use rbx_dom_weak::{RbxId, RbxTree};
use self::{
context::InstanceSnapshotContext,
csv::SnapshotCsv,
dir::SnapshotDir,
json_model::SnapshotJsonModel,
@@ -43,10 +44,12 @@ macro_rules! middlewares {
imfs: &mut Imfs<F>,
entry: &ImfsEntry,
) -> SnapshotInstanceResult<'static> {
let context = InstanceSnapshotContext::default();
$(
log::trace!("trying middleware {} on {}", stringify!($middleware), entry.path().display());
if let Some(snapshot) = $middleware::from_imfs(imfs, entry)? {
if let Some(snapshot) = $middleware::from_imfs(&context, imfs, entry)? {
log::trace!("middleware {} success on {}", stringify!($middleware), entry.path().display());
return Ok(Some(snapshot));
}