mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-24 06:35:39 +00:00
Thread InstanceSnapshotContext through all SnapshotMiddleware
This commit is contained in:
@@ -8,6 +8,7 @@ use crate::{
|
||||
};
|
||||
|
||||
use super::{
|
||||
context::InstanceSnapshotContext,
|
||||
middleware::{SnapshotInstanceResult, SnapshotMiddleware},
|
||||
util::match_file_name,
|
||||
};
|
||||
@@ -16,6 +17,7 @@ pub struct SnapshotRbxm;
|
||||
|
||||
impl SnapshotMiddleware for SnapshotRbxm {
|
||||
fn from_imfs<F: ImfsFetcher>(
|
||||
_context: &InstanceSnapshotContext,
|
||||
imfs: &mut Imfs<F>,
|
||||
entry: &ImfsEntry,
|
||||
) -> SnapshotInstanceResult<'static> {
|
||||
@@ -68,7 +70,10 @@ mod test {
|
||||
imfs.debug_load_snapshot("/foo.rbxm", file);
|
||||
|
||||
let entry = imfs.get("/foo.rbxm").unwrap();
|
||||
let instance_snapshot = SnapshotRbxm::from_imfs(&mut imfs, &entry).unwrap().unwrap();
|
||||
let instance_snapshot =
|
||||
SnapshotRbxm::from_imfs(&InstanceSnapshotContext::default(), &mut imfs, &entry)
|
||||
.unwrap()
|
||||
.unwrap();
|
||||
|
||||
assert_eq!(instance_snapshot.name, "foo");
|
||||
assert_eq!(instance_snapshot.class_name, "Folder");
|
||||
|
||||
Reference in New Issue
Block a user