Improve 'Config::set_raw_tls()' implementation.

This commit is contained in:
Sergio Benitez 2018-07-02 20:02:23 -07:00
parent 88d3b59c71
commit bd6cdecf00
1 changed files with 5 additions and 6 deletions

View File

@ -584,15 +584,14 @@ impl Config {
Ok(())
}
#[cfg(not(test))]
#[inline(always)]
fn set_raw_tls(&mut self, paths: (&str, &str)) -> Result<()> {
self.set_tls(paths.0, paths.1)
}
#[cfg(not(test))]
{ self.set_tls(paths.0, paths.1) }
#[cfg(test)]
fn set_raw_tls(&mut self, _: (&str, &str)) -> Result<()> {
Ok(())
// During unit testing, we don't want to actually read certs/keys.
#[cfg(test)]
{ Ok(()) }
}
/// Sets the extras for `self` to be the key/value pairs in `extras`.