豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Commit 6ba6df5

Browse files
chore: fmt
1 parent 774d534 commit 6ba6df5

File tree

4 files changed

+41
-39
lines changed

4 files changed

+41
-39
lines changed

src/future.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ use hyper::body::{Body as HttpBody, Incoming};
99
use hyper_util::client::legacy::connect::Connect;
1010
use hyper_util::client::legacy::{Client, ResponseFuture};
1111

12-
use crate::rewrite::PathRewriter;
1312
use crate::Error;
13+
use crate::rewrite::PathRewriter;
1414

1515
type BoxErr = Box<dyn std::error::Error + Send + Sync>;
1616

src/lib.rs

Lines changed: 34 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,12 @@ pub use oneshot::OneshotService;
143143

144144
#[cfg(any(feature = "http1", feature = "http2"))]
145145
mod reused;
146+
#[cfg(any(feature = "http1", feature = "http2"))]
147+
#[cfg_attr(docsrs, doc(cfg(any(feature = "http1", feature = "http2"))))]
148+
pub use reused::Builder as ReusedServiceBuilder;
149+
#[cfg(any(feature = "http1", feature = "http2"))]
150+
#[cfg_attr(docsrs, doc(cfg(any(feature = "http1", feature = "http2"))))]
151+
pub use reused::ReusedService;
146152
#[cfg(all(
147153
any(feature = "http1", feature = "http2"),
148154
any(feature = "https", feature = "nativetls")
@@ -169,12 +175,6 @@ pub use reused::builder_nativetls;
169175
pub use reused::builder_rustls;
170176
#[cfg(any(feature = "http1", feature = "http2"))]
171177
#[cfg_attr(docsrs, doc(cfg(any(feature = "http1", feature = "http2"))))]
172-
pub use reused::Builder as ReusedServiceBuilder;
173-
#[cfg(any(feature = "http1", feature = "http2"))]
174-
#[cfg_attr(docsrs, doc(cfg(any(feature = "http1", feature = "http2"))))]
175-
pub use reused::ReusedService;
176-
#[cfg(any(feature = "http1", feature = "http2"))]
177-
#[cfg_attr(docsrs, doc(cfg(any(feature = "http1", feature = "http2"))))]
178178
pub use reused::{builder, builder_http};
179179

180180
#[cfg(not(feature = "http1"))]
@@ -184,7 +184,9 @@ compile_error!("http1 is a mandatory feature");
184184
any(feature = "rustls-ring", feature = "rustls-aws-lc"),
185185
not(any(feature = "rustls-webpki-roots", feature = "rustls-native-roots"))
186186
))]
187-
compile_error!("When enabling rustls-ring and/or rustls-aws-lc, you must enable rustls-webpki-roots and/or rustls-native-roots");
187+
compile_error!(
188+
"When enabling rustls-ring and/or rustls-aws-lc, you must enable rustls-webpki-roots and/or rustls-native-roots"
189+
);
188190

189191
#[cfg(test)]
190192
mod test_helper {
@@ -204,11 +206,11 @@ mod test_helper {
204206
expected: (StatusCode, &str),
205207
) where
206208
S: Service<
207-
Request<String>,
208-
Response = Result<Response<Incoming>, Error>,
209-
Error = Infallible,
210-
Future = RevProxyFuture,
211-
>,
209+
Request<String>,
210+
Response = Result<Response<Incoming>, Error>,
211+
Error = Infallible,
212+
Future = RevProxyFuture,
213+
>,
212214
B: Into<String>,
213215
{
214216
let mut builder = Request::builder()
@@ -236,11 +238,11 @@ mod test_helper {
236238
pub async fn match_path<S>(server: &mut ServerGuard, svc: &mut S)
237239
where
238240
S: Service<
239-
Request<String>,
240-
Response = Result<Response<Incoming>, Error>,
241-
Error = Infallible,
242-
Future = RevProxyFuture,
243-
>,
241+
Request<String>,
242+
Response = Result<Response<Incoming>, Error>,
243+
Error = Infallible,
244+
Future = RevProxyFuture,
245+
>,
244246
{
245247
let _mk = server
246248
.mock("GET", "/goo/bar/goo/baz/goo")
@@ -266,11 +268,11 @@ mod test_helper {
266268
pub async fn match_query<S>(server: &mut ServerGuard, svc: &mut S)
267269
where
268270
S: Service<
269-
Request<String>,
270-
Response = Result<Response<Incoming>, Error>,
271-
Error = Infallible,
272-
Future = RevProxyFuture,
273-
>,
271+
Request<String>,
272+
Response = Result<Response<Incoming>, Error>,
273+
Error = Infallible,
274+
Future = RevProxyFuture,
275+
>,
274276
{
275277
let _mk = server
276278
.mock("GET", "/goo")
@@ -297,11 +299,11 @@ mod test_helper {
297299
pub async fn match_post<S>(server: &mut ServerGuard, svc: &mut S)
298300
where
299301
S: Service<
300-
Request<String>,
301-
Response = Result<Response<Incoming>, Error>,
302-
Error = Infallible,
303-
Future = RevProxyFuture,
304-
>,
302+
Request<String>,
303+
Response = Result<Response<Incoming>, Error>,
304+
Error = Infallible,
305+
Future = RevProxyFuture,
306+
>,
305307
{
306308
let _mk = server
307309
.mock("POST", "/goo")
@@ -330,11 +332,11 @@ mod test_helper {
330332
pub async fn match_header<S>(server: &mut ServerGuard, svc: &mut S)
331333
where
332334
S: Service<
333-
Request<String>,
334-
Response = Result<Response<Incoming>, Error>,
335-
Error = Infallible,
336-
Future = RevProxyFuture,
337-
>,
335+
Request<String>,
336+
Response = Result<Response<Incoming>, Error>,
337+
Error = Infallible,
338+
Future = RevProxyFuture,
339+
>,
338340
{
339341
let _mk = server
340342
.mock("POST", "/goo")

src/oneshot.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ use http::{Error as HttpError, Request, Response};
1010
use hyper::body::{Body as HttpBody, Incoming};
1111
#[cfg(feature = "nativetls")]
1212
use hyper_tls::HttpsConnector as NativeTlsConnector;
13-
use hyper_util::client::legacy::connect::Connect;
1413
use hyper_util::client::legacy::Client;
14+
use hyper_util::client::legacy::connect::Connect;
1515
use tower_service::Service;
1616

1717
use crate::future::RevProxyFuture;
1818
use crate::rewrite::PathRewriter;
19-
use crate::{client, Error};
19+
use crate::{Error, client};
2020

2121
type BoxErr = Box<dyn std::error::Error + Send + Sync>;
2222

@@ -250,7 +250,7 @@ mod test {
250250
use mockito::ServerGuard;
251251

252252
use super::*;
253-
use crate::{test_helper, ReplaceAll};
253+
use crate::{ReplaceAll, test_helper};
254254

255255
async fn make_svc() -> (
256256
ServerGuard,

src/reused.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ use http::{Error as HttpError, Request, Response};
1010
use hyper::body::{Body as HttpBody, Incoming};
1111
#[cfg(feature = "nativetls")]
1212
use hyper_tls::HttpsConnector as NativeTlsConnector;
13-
use hyper_util::client::legacy::connect::Connect;
1413
use hyper_util::client::legacy::Client;
14+
use hyper_util::client::legacy::connect::Connect;
1515
use tower_service::Service;
1616

1717
use crate::future::RevProxyFuture;
1818
use crate::rewrite::PathRewriter;
19-
use crate::{client, Error};
19+
use crate::{Error, client};
2020

2121
type BoxErr = Box<dyn std::error::Error + Send + Sync>;
2222

@@ -393,7 +393,7 @@ mod test {
393393
use mockito::ServerGuard;
394394

395395
use super::*;
396-
use crate::{test_helper, ReplaceAll};
396+
use crate::{ReplaceAll, test_helper};
397397

398398
async fn make_svc() -> (
399399
ServerGuard,

0 commit comments

Comments
 (0)