[BOT-272] Change function from ::extend to ::from_client

This commit is contained in:
Stefan Adrian Danaita 2024-05-03 17:27:51 +01:00 committed by Ethan Brierley
parent 8d394a964a
commit 7dc0560d38

View file

@ -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.