The Config::trust_cert_ca method currently takes a path-parameter that looks like this: path: impl ToString which then gets converted to a PathBuf. Is there a reason the trust_cert_ca method doesn't take a PathBuf directly? I'd argue it would be more correct since there are valid paths that are not valid UTF-8 strings.
Current impl:
pub fn trust_cert_ca(&mut self, path: impl ToString) {
if let TrustConfig::TrustAll = &self.trust {
panic!("'trust_cert' and 'trust_cert_ca' are mutual exclusive! Only use one.")
} else {
self.trust = TrustConfig::CaCertificateLocation(PathBuf::from(path.to_string()))
}
}
Proposed impl:
pub fn trust_cert_ca(&mut self, path: impl Into<PathBuf>) {
if let TrustConfig::TrustAll = &self.trust {
panic!("'trust_cert' and 'trust_cert_ca' are mutual exclusive! Only use one.")
} else {
self.trust = TrustConfig::CaCertificateLocation(path.into())
}
}
The
Config::trust_cert_ca
method currently takes a path-parameter that looks like this:path: impl ToString
which then gets converted to a PathBuf. Is there a reason thetrust_cert_ca
method doesn't take a PathBuf directly? I'd argue it would be more correct since there are valid paths that are not valid UTF-8 strings.Current impl:
Proposed impl:
I'd be happy to send a PR!