inspector: Trim the diagnostic error at the end (#1210)

This commit is contained in:
Floyd Wang 2025-09-05 15:21:25 +08:00 committed by GitHub
parent c6f6a9bb09
commit 19be9b8d96
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -198,8 +198,7 @@ impl DivInspector {
self.update_element_style(new_style, window, cx); self.update_element_style(new_style, window, cx);
} }
Err(e) => { Err(e) => {
let e = format!("{}", e); self.json_state.error = Some(e.to_string().trim_end().to_string().into());
self.json_state.error = Some(e.into());
window.refresh(); window.refresh();
} }
} }
@ -378,7 +377,7 @@ fn rust_to_style(
let err = if err.is_empty() { let err = if err.is_empty() {
None None
} else { } else {
Some(err.into()) Some(err.trim_end().to_string().into())
}; };
(style, err) (style, err)
} }