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);
}
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)
}