Skip to content

Commit

Permalink
axum-core/macros: Change body_text() impl to use Display
Browse files Browse the repository at this point in the history
Since they both result in the same thing we might as well take advantage of one in the other.
  • Loading branch information
Turbo87 committed Dec 27, 2024
1 parent 0a67496 commit ac549f3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions axum-core/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ macro_rules! __define_rejection {
impl $name {
/// Get the response body text used for this rejection.
pub fn body_text(&self) -> String {
$body.into()
self.to_string()
}

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

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

/// Get the status code used for this rejection.
Expand Down

0 comments on commit ac549f3

Please sign in to comment.