aboutsummaryrefslogtreecommitdiff
path: root/mingling_core/src/program/error.rs
diff options
context:
space:
mode:
authorWeicao-CatilGrass <1992414357@qq.com>2026-05-31 02:42:52 +0800
committer魏曹先生 <1992414357@qq.com>2026-05-31 17:19:20 +0800
commit2aa7bda3cb21ce6c052b82e08bcab79a625d04f2 (patch)
treef10b89007fc67ca1a948f34abe6869b49296b932 /mingling_core/src/program/error.rs
parent3aa409a55e4f2f0ab41b0949cc06eb13c2da4a43 (diff)
Enhance code quality across the entire codebase
Diffstat (limited to 'mingling_core/src/program/error.rs')
-rw-r--r--mingling_core/src/program/error.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/mingling_core/src/program/error.rs b/mingling_core/src/program/error.rs
index 03e9af6..822e429 100644
--- a/mingling_core/src/program/error.rs
+++ b/mingling_core/src/program/error.rs
@@ -9,9 +9,9 @@ pub struct ProgramPanic {
impl fmt::Display for ProgramPanic {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
if let Some(s) = self.payload.downcast_ref::<&str>() {
- write!(f, "{}", s)
+ write!(f, "{s}")
} else if let Some(s) = self.payload.downcast_ref::<String>() {
- write!(f, "{}", s)
+ write!(f, "{s}")
} else {
write!(f, "")
}
@@ -19,6 +19,7 @@ impl fmt::Display for ProgramPanic {
}
impl ProgramPanic {
+ #[must_use]
pub fn new(payload: Box<dyn Any + Send>) -> Self {
ProgramPanic { payload }
}