File tree Expand file tree Collapse file tree 4 files changed +8
-8
lines changed Expand file tree Collapse file tree 4 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 1
1
[package ]
2
2
name = " http-types"
3
- version = " 1.0.0 "
3
+ version = " 1.0.1 "
4
4
license = " MIT OR Apache-2.0"
5
5
repository = " https://github.com/http-rs/http-types"
6
6
documentation = " https://docs.rs/http-types"
Original file line number Diff line number Diff line change @@ -120,7 +120,7 @@ mod macros;
120
120
mod method;
121
121
mod request;
122
122
mod response;
123
- mod result_ext ;
123
+ mod status ;
124
124
mod status_code;
125
125
mod type_map;
126
126
mod version;
@@ -130,7 +130,7 @@ pub use error::{Error, Result};
130
130
pub use method:: Method ;
131
131
pub use request:: Request ;
132
132
pub use response:: Response ;
133
- pub use result_ext :: ResultExt ;
133
+ pub use status :: Status ;
134
134
pub use status_code:: StatusCode ;
135
135
pub use version:: Version ;
136
136
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ use std::error::Error as StdError;
5
5
/// Provides the `status` method for `Result`.
6
6
///
7
7
/// This trait is sealed and cannot be implemented outside of `http-types`.
8
- pub trait ResultExt < T , E > : private:: Sealed {
8
+ pub trait Status < T , E > : private:: Sealed {
9
9
/// Wrap the error value with an additional status code.
10
10
fn status < S > ( self , status : S ) -> Result < T , Error >
11
11
where
@@ -21,7 +21,7 @@ pub trait ResultExt<T, E>: private::Sealed {
21
21
F : FnOnce ( ) -> S ;
22
22
}
23
23
24
- impl < T , E > ResultExt < T , E > for Result < T , E >
24
+ impl < T , E > Status < T , E > for Result < T , E >
25
25
where
26
26
E : StdError + Send + Sync + ' static ,
27
27
{
49
49
}
50
50
}
51
51
52
- impl < T > ResultExt < T , Infallible > for Option < T > {
52
+ impl < T > Status < T , Infallible > for Option < T > {
53
53
fn status < S > ( self , status : S ) -> Result < T , Error >
54
54
where
55
55
S : TryInto < StatusCode > ,
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ fn ensure_eq() {
46
46
47
47
#[ test]
48
48
fn result_ext ( ) {
49
- use http_types:: ResultExt ;
49
+ use http_types:: Status ;
50
50
fn run ( ) -> http_types:: Result < ( ) > {
51
51
let err = io:: Error :: new ( io:: ErrorKind :: Other , "Oh no" ) ;
52
52
Err ( err) . status ( StatusCode :: NotFound ) ?;
@@ -61,7 +61,7 @@ fn result_ext() {
61
61
62
62
#[ test]
63
63
fn option_ext ( ) {
64
- use http_types:: ResultExt ;
64
+ use http_types:: Status ;
65
65
fn run ( ) -> http_types:: Result < ( ) > {
66
66
None . status ( StatusCode :: NotFound )
67
67
}
You can’t perform that action at this time.
0 commit comments