Browse Source

Regroup the chained calls to `.replace()` into a single one

pull/76/head
Rodolphe Bréard 2 years ago
parent
commit
2895ce4495
  1. 2
      acme_common/src/crypto.rs
  2. 2
      acmed/src/config.rs

2
acme_common/src/crypto.rs

@ -58,7 +58,7 @@ impl FromStr for BaseHashFunction {
type Err = Error;
fn from_str(s: &str) -> Result<Self, Error> {
let s = s.to_lowercase().replace('-', "").replace('_', "");
let s = s.to_lowercase().replace(['-', '_'], "");
match s.as_str() {
"sha256" => Ok(BaseHashFunction::Sha256),
"sha384" => Ok(BaseHashFunction::Sha384),

2
acmed/src/config.rs

@ -483,7 +483,7 @@ impl Certificate {
id.to_string()
}
};
let name = name.replace('*', "_").replace(':', "_").replace('/', "_");
let name = name.replace(['*', ':', '/'], "_");
Ok(name)
}

Loading…
Cancel
Save