Skip to content

Commit 2c6e3f1

Browse files
jbryoshuawuyts
andcommitted
Apply suggestions from code review
keep the type_name a &'static str Co-authored-by: Yoshua Wuyts <[email protected]>
1 parent 644fdf8 commit 2c6e3f1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/error.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub type Result<T> = std::result::Result<T, Error>;
1616
pub struct Error {
1717
error: anyhow::Error,
1818
status: crate::StatusCode,
19-
type_name: Option<String>,
19+
type_name: Option<&'static str>,
2020
}
2121

2222
impl Error {
@@ -36,7 +36,7 @@ impl Error {
3636
.try_into()
3737
.expect("Could not convert into a valid `StatusCode`"),
3838
error: error.into(),
39-
type_name: Some(std::any::type_name::<E>().to_string()),
39+
type_name: Some(std::any::type_name::<E>()),
4040
}
4141
}
4242

0 commit comments

Comments
 (0)