Skip to content

Commit ac549f3

Browse files
committed
axum-core/macros: Change body_text() impl to use Display
Since they both result in the same thing we might as well take advantage of one in the other.
1 parent 0a67496 commit ac549f3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

axum-core/src/macros.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ macro_rules! __define_rejection {
5050
impl $name {
5151
/// Get the response body text used for this rejection.
5252
pub fn body_text(&self) -> String {
53-
$body.into()
53+
self.to_string()
5454
}
5555

5656
/// Get the status code used for this rejection.
@@ -107,7 +107,7 @@ macro_rules! __define_rejection {
107107

108108
/// Get the response body text used for this rejection.
109109
pub fn body_text(&self) -> String {
110-
format!(concat!($body, ": {}"), self.0).into()
110+
self.to_string()
111111
}
112112

113113
/// Get the status code used for this rejection.

0 commit comments

Comments
 (0)