Skip to content

Commit afb0efb

Browse files
committed
Update timeout.rs
1 parent 61ec555 commit afb0efb

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

crates/rustapi-extras/src/timeout.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
//! }
2121
//! ```
2222
23-
use rustapi_core::{middleware::BoxedNext, middleware::MiddlewareLayer, Request, Response, ResponseBody};
23+
use rustapi_core::{
24+
middleware::BoxedNext, middleware::MiddlewareLayer, Request, Response, ResponseBody,
25+
};
2426
use std::future::Future;
2527
use std::pin::Pin;
2628
use std::time::Duration;
@@ -98,7 +100,7 @@ impl MiddlewareLayer for TimeoutLayer {
98100
}
99101
})
100102
.to_string(),
101-
)))
103+
))))
102104
.unwrap()
103105
}
104106
}
@@ -129,7 +131,9 @@ mod tests {
129131
sleep(Duration::from_millis(200)).await;
130132
http::Response::builder()
131133
.status(200)
132-
.body(ResponseBody::Full(http_body_util::Full::new(bytes::Bytes::from("OK"))))
134+
.body(ResponseBody::Full(http_body_util::Full::new(
135+
bytes::Bytes::from("OK"),
136+
)))
133137
.unwrap()
134138
}) as Pin<Box<dyn Future<Output = Response> + Send + 'static>>
135139
});
@@ -155,7 +159,9 @@ mod tests {
155159
sleep(Duration::from_millis(50)).await;
156160
http::Response::builder()
157161
.status(200)
158-
.body(ResponseBody::Full(http_body_util::Full::new(bytes::Bytes::from("OK"))))
162+
.body(ResponseBody::Full(http_body_util::Full::new(
163+
bytes::Bytes::from("OK"),
164+
)))
159165
.unwrap()
160166
}) as Pin<Box<dyn Future<Output = Response> + Send + 'static>>
161167
});

0 commit comments

Comments
 (0)