diff --git a/src/load_roblox.rs b/src/load_roblox.rs index 0142f09..ec04d46 100644 --- a/src/load_roblox.rs +++ b/src/load_roblox.rs @@ -36,17 +36,19 @@ fn get_texture_refs(dom:&rbx_dom_weak::WeakDom) -> Vec struct RobloxAssetId(u64); struct RobloxAssetIdParseErr; impl std::str::FromStr for RobloxAssetId { - type Err=RobloxAssetIdParseErr; - fn from_str(s: &str) -> Result{ - let regman=regex::Regex::new(r"(\d+)$").unwrap(); - if let Some(captures) = regman.captures(s) { - if captures.len()==2{//captures[0] is all captures concatenated, and then each individual capture - if let Ok(id) = captures[0].parse::() { - return Ok(Self(id)); - } - } - } - Err(RobloxAssetIdParseErr) + type Err=RobloxAssetIdParseErr; + fn from_str(s: &str) -> Result{ + let regman=regex::Regex::new(r"(\d+)$").unwrap(); + if let Some(captures) = regman.captures(s) { + if captures.len()==2{//captures[0] is all captures concatenated, and then each individual capture + if let Ok(id) = captures[0].parse::() { + return Ok(Self(id)); + } + } + } + Err(RobloxAssetIdParseErr) + } +} } } pub fn generate_modeldatas_roblox(dom:rbx_dom_weak::WeakDom) -> Result<(Vec,Vec,glam::Vec3), Box>{