Commit 53370b2 1 parent 287bd14 commit 53370b2 Copy full SHA for 53370b2
File tree 2 files changed +11
-3
lines changed
2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
10
10
# 0.5.0
11
11
12
+ - ** change:** The ` Display ` impl of all rejections generated by the
13
+ ` define_rejection!() ` will now include the ` Display ` output of the
14
+ inner error too. This matches the ` body_text() ` fn output now. ([ #3118 ] )
15
+
16
+ [ #3118 ] : https://github.com/tokio-rs/axum/pull/3118
17
+
12
18
## rc.1
13
19
14
20
- ** breaking:** : ` Option<T> ` as an extractor now requires ` T ` to implement the
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ macro_rules! __define_rejection {
50
50
impl $name {
51
51
/// Get the response body text used for this rejection.
52
52
pub fn body_text( & self ) -> String {
53
- $body . into ( )
53
+ self . to_string ( )
54
54
}
55
55
56
56
/// Get the status code used for this rejection.
@@ -107,7 +107,7 @@ macro_rules! __define_rejection {
107
107
108
108
/// Get the response body text used for this rejection.
109
109
pub fn body_text( & self ) -> String {
110
- format! ( concat! ( $body , ": {}" ) , self . 0 ) . into ( )
110
+ self . to_string ( )
111
111
}
112
112
113
113
/// Get the status code used for this rejection.
@@ -132,7 +132,9 @@ macro_rules! __define_rejection {
132
132
133
133
impl std:: fmt:: Display for $name {
134
134
fn fmt( & self , f: & mut std:: fmt:: Formatter <' _>) -> std:: fmt:: Result {
135
- write!( f, "{}" , $body)
135
+ f. write_str( $body) ?;
136
+ f. write_str( ": " ) ?;
137
+ self . 0 . fmt( f)
136
138
}
137
139
}
138
140
You can’t perform that action at this time.
0 commit comments