Skip to content

Commit

Permalink
VTX-3411: fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
fsdvh committed Dec 6, 2023
1 parent da7a117 commit 455ee53
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions object_store/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ pub enum ClientConfigKey {
/// User-Agent header to be used by this client
UserAgent,
/// PEM-formatted CA certificate
RootCa
RootCa,
}

impl AsRef<str> for ClientConfigKey {
Expand Down Expand Up @@ -160,11 +160,11 @@ impl FromStr for ClientConfigKey {
"proxy_url" => Ok(Self::ProxyUrl),
"timeout" => Ok(Self::Timeout),
"user_agent" => Ok(Self::UserAgent),
"root_ca" => Ok(Self::RootCa),
_ => Err(super::Error::UnknownConfigurationKey {
store: "HTTP",
key: s.into(),
}),
"root_ca" => Ok(Self::RootCa),
}
}
}
Expand Down Expand Up @@ -238,9 +238,7 @@ impl ClientOptions {
ClientConfigKey::UserAgent => {
self.user_agent = Some(ConfigValue::Deferred(value.into()))
}
ClientConfigKey::RootCa => {
self.root_ca = Some(value.into())
}
ClientConfigKey::RootCa => self.root_ca = Some(value.into()),
}
self
}
Expand Down Expand Up @@ -282,9 +280,7 @@ impl ClientOptions {
.as_ref()
.and_then(|v| v.get().ok())
.and_then(|v| v.to_str().ok().map(|s| s.to_string())),
ClientConfigKey::RootCa => self
.root_ca
.clone(),
ClientConfigKey::RootCa => self.root_ca.clone(),
}
}

Expand Down Expand Up @@ -437,7 +433,6 @@ impl ClientOptions {
self
}


/// Set a trusted CA certificate
pub fn with_root_ca(mut self, root_ca: impl Into<String>) -> Self {
self.root_ca = Some(root_ca.into());
Expand Down Expand Up @@ -811,9 +806,7 @@ mod tests {
user_agent
);
assert_eq!(
builder
.get_config_value(&ClientConfigKey::RootCa)
.unwrap(),
builder.get_config_value(&ClientConfigKey::RootCa).unwrap(),
root_ca
);
}
Expand Down

0 comments on commit 455ee53

Please sign in to comment.