mirror of
https://github.com/TrueLayer/reqwest-middleware.git
synced 2024-12-26 19:06:31 +00:00
[BOT-272] Change function from ::extend to ::from_client
This commit is contained in:
parent
8d394a964a
commit
7dc0560d38
1 changed files with 8 additions and 8 deletions
|
@ -31,14 +31,14 @@ impl ClientBuilder {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Convenience method to extend a ClientBuilder instance by appending
|
/// Convenience method to create a ClientBuilder
|
||||||
/// the middleware and initialiser stacks from a ClientwithMiddleware
|
/// from an existing ClientWithMiddleware instance
|
||||||
pub fn extend(mut self, client_with_middleware: ClientWithMiddleware) -> Self {
|
pub fn from_client(client_with_middleware: ClientWithMiddleware) -> Self {
|
||||||
self.middleware_stack
|
Self {
|
||||||
.append(&mut client_with_middleware.middleware_stack.into_vec());
|
client: client_with_middleware.inner,
|
||||||
self.initialiser_stack
|
middleware_stack: client_with_middleware.middleware_stack.into_vec(),
|
||||||
.append(&mut client_with_middleware.initialiser_stack.into_vec());
|
initialiser_stack: client_with_middleware.initialiser_stack.into_vec(),
|
||||||
self
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Convenience method to attach middleware.
|
/// Convenience method to attach middleware.
|
||||||
|
|
Loading…
Reference in a new issue