From b404908a55786570fcfa09eef2c70c8fa6ad757d Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 26 Sep 2023 20:23:59 -0700 Subject: [PATCH] Tabs --- src/load_roblox.rs | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/load_roblox.rs b/src/load_roblox.rs index 0142f099..ec04d46e 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>{