-
Hi folks, I've a small rust beginner problem: let client = get_reqwest_client();
// configure health checks
let health_checkers: Vec<Box<dyn HealthChecker>> =
vec![Box::new(ExternalAuthHealthChecker::new(&config, &client))];
let shared_state = Arc::new(ApplicationState {
config: config,
health_checker: health_checkers,
request_client: client,
}); I would solute it with clone() . |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Okay, no answere needed anymore. |
Beta Was this translation helpful? Give feedback.
Okay, no answere needed anymore.
The implementations seems to derive clone, so it calls clone() on the inner Arc and I have a cloned reference to the original client.
So there is no problem by using multiple clients which was created by a clone():
https://docs.rs/reqwest/latest/src/reqwest/async_impl/client.rs.html#68