mirror of
https://github.com/TrueLayer/reqwest-middleware.git
synced 2024-12-26 02:46:30 +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
|
||||
/// the middleware and initialiser stacks from a ClientwithMiddleware
|
||||
pub fn extend(mut self, client_with_middleware: ClientWithMiddleware) -> Self {
|
||||
self.middleware_stack
|
||||
.append(&mut client_with_middleware.middleware_stack.into_vec());
|
||||
self.initialiser_stack
|
||||
.append(&mut client_with_middleware.initialiser_stack.into_vec());
|
||||
self
|
||||
/// Convenience method to create a ClientBuilder
|
||||
/// from an existing ClientWithMiddleware instance
|
||||
pub fn from_client(client_with_middleware: ClientWithMiddleware) -> Self {
|
||||
Self {
|
||||
client: client_with_middleware.inner,
|
||||
middleware_stack: client_with_middleware.middleware_stack.into_vec(),
|
||||
initialiser_stack: client_with_middleware.initialiser_stack.into_vec(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Convenience method to attach middleware.
|
||||
|
|
Loading…
Reference in a new issue