From 30b1d03e20154e1ab64d1b41f75ac36a11ca1195 Mon Sep 17 00:00:00 2001 From: Miles Murgaw Date: Tue, 10 Dec 2024 19:05:14 -0500 Subject: [PATCH] revision: canonicalize err handling --- packages/cli/src/serve/handle.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/packages/cli/src/serve/handle.rs b/packages/cli/src/serve/handle.rs index a68406fc43..f5968f3ae2 100644 --- a/packages/cli/src/serve/handle.rs +++ b/packages/cli/src/serve/handle.rs @@ -189,13 +189,9 @@ impl AppHandle { } // Canonicalize the path as Windows may use long-form paths "\\\\?\\C:\\". - let changed_file = match fs::canonicalize(changed_file) { - Ok(c) => c, - Err(e) => { - tracing::debug!("Failed to canonicalize hotreloaded asset: {e}"); - return None; - } - }; + let changed_file = fs::canonicalize(changed_file) + .inspect_err(|e| tracing::debug!("Failed to canonicalize hotreloaded asset: {e}")) + .ok()?; // The asset might've been renamed thanks to the manifest, let's attempt to reload that too if let Some(resource) = self.app.app.assets.assets.get(&changed_file).as_ref() {