aboutsummaryrefslogtreecommitdiff
path: root/mingling_core/src/program/error.rs
diff options
context:
space:
mode:
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 }
}