mirror of
https://github.com/storytold/materialcraft.git
synced 2026-11-21 23:10:54 +01:00
formats: format the SBS size check
This commit is contained in:
1 file changed
+9
-2
@@ -33,8 +33,15 @@ pub fn read_sbs(bytes: &[u8], name: &str, linked: &dyn Fn(&str) -> Option<Vec<u8
|
||||
_ => "Untitled package".to_string(),
|
||||
};
|
||||
|
||||
let mut reader =
|
||||
SbsReader { text, warnings: &mut warnings, dependencies: HashMap::new(), graph_names: HashMap::new(), resource_names: HashMap::new(), node_count: 0, wire_count: 0 };
|
||||
let mut reader = SbsReader {
|
||||
text,
|
||||
warnings: &mut warnings,
|
||||
dependencies: HashMap::new(),
|
||||
graph_names: HashMap::new(),
|
||||
resource_names: HashMap::new(),
|
||||
node_count: 0,
|
||||
wire_count: 0,
|
||||
};
|
||||
for dependency in child_element(root, "dependencies").into_iter().flat_map(|d| children_named(d, "dependency")) {
|
||||
if let (Some(uid), Some(file)) = (child_value(dependency, "uid"), child_value(dependency, "filename")) {
|
||||
reader.dependencies.insert(uid.to_string(), file.to_string());
|
||||
|
||||
Reference in new issue
Block a user