Fix Clippy warnings in util
crate (#8721)
This PR fixes a number of Clippy warnings in the `util` crate. Release Notes: - N/A
This commit is contained in:
parent
0ac203bde0
commit
c19587d4e4
4 changed files with 20 additions and 16 deletions
|
@ -128,22 +128,25 @@ impl HttpClient for isahc::HttpClient {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "test-support")]
|
||||
type FakeHttpHandler = Box<
|
||||
dyn Fn(Request<AsyncBody>) -> BoxFuture<'static, Result<Response<AsyncBody>, Error>>
|
||||
+ Send
|
||||
+ Sync
|
||||
+ 'static,
|
||||
>;
|
||||
|
||||
#[cfg(feature = "test-support")]
|
||||
pub struct FakeHttpClient {
|
||||
handler: Box<
|
||||
dyn 'static
|
||||
+ Send
|
||||
+ Sync
|
||||
+ Fn(Request<AsyncBody>) -> BoxFuture<'static, Result<Response<AsyncBody>, Error>>,
|
||||
>,
|
||||
handler: FakeHttpHandler,
|
||||
}
|
||||
|
||||
#[cfg(feature = "test-support")]
|
||||
impl FakeHttpClient {
|
||||
pub fn create<Fut, F>(handler: F) -> Arc<HttpClientWithUrl>
|
||||
where
|
||||
Fut: 'static + Send + futures::Future<Output = Result<Response<AsyncBody>, Error>>,
|
||||
F: 'static + Send + Sync + Fn(Request<AsyncBody>) -> Fut,
|
||||
Fut: futures::Future<Output = Result<Response<AsyncBody>, Error>> + Send + 'static,
|
||||
F: Fn(Request<AsyncBody>) -> Fut + Send + Sync + 'static,
|
||||
{
|
||||
Arc::new(HttpClientWithUrl {
|
||||
base_url: Mutex::new("http://test.example".into()),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue