Skip to content

Commit 7821e22

Browse files
jbryoshuawuyts
andauthored
Apply suggestions from code review
keep the type_name a &'static str Co-authored-by: Yoshua Wuyts <[email protected]>
1 parent 9aa84f3 commit 7821e22

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/error.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub type Result<T> = std::result::Result<T, Error>;
1515
pub struct Error {
1616
error: anyhow::Error,
1717
status: crate::StatusCode,
18-
type_name: Option<String>,
18+
type_name: Option<&'static str>,
1919
}
2020

2121
impl Error {
@@ -28,7 +28,7 @@ impl Error {
2828
Self {
2929
status,
3030
error: error.into(),
31-
type_name: Some(std::any::type_name::<E>().to_string()),
31+
type_name: Some(std::any::type_name::<E>()),
3232
}
3333
}
3434

0 commit comments

Comments
 (0)