From 19be9b8d96bc6653d918decaec3eb4dae5dd785d Mon Sep 17 00:00:00 2001 From: Floyd Wang Date: Fri, 5 Sep 2025 15:21:25 +0800 Subject: [PATCH] inspector: Trim the diagnostic error at the end (#1210) --- crates/ui/src/inspector.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/crates/ui/src/inspector.rs b/crates/ui/src/inspector.rs index 565789ee..104f093a 100644 --- a/crates/ui/src/inspector.rs +++ b/crates/ui/src/inspector.rs @@ -198,8 +198,7 @@ impl DivInspector { self.update_element_style(new_style, window, cx); } Err(e) => { - let e = format!("{}", e); - self.json_state.error = Some(e.into()); + self.json_state.error = Some(e.to_string().trim_end().to_string().into()); window.refresh(); } } @@ -378,7 +377,7 @@ fn rust_to_style( let err = if err.is_empty() { None } else { - Some(err.into()) + Some(err.trim_end().to_string().into()) }; (style, err) }