refactor: derive Clone for IOx client builder

Allows an IOx client builder (with its associated configuration) to be
cloned.
pull/24376/head
Dom 2021-10-05 15:42:44 +02:00
parent 08d69d3da7
commit 53e49156d6
1 changed files with 13 additions and 1 deletions

View File

@ -68,7 +68,7 @@ pub type Result<T, E = Error> = std::result::Result<T, E>;
/// .expect("connection must succeed");
/// # }
/// ```
#[derive(Debug)]
#[derive(Debug, Clone)]
pub struct Builder {
user_agent: String,
headers: Vec<(HeaderName, HeaderValue)>,
@ -171,3 +171,15 @@ impl Builder {
Self { timeout, ..self }
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_builder_cloneable() {
// Clone is used by Conductor.
fn assert_clone<T: Clone>(_t: T) {}
assert_clone(Builder::default())
}
}