Remove From<Path> for Certificate
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Deserialization from a path is a heavy conversion. This should be done by an explicit `Certificate::new_from_cbor` call.
This commit is contained in:
parent
74f84913c0
commit
6a22429632
2 changed files with 1 additions and 8 deletions
|
@ -106,10 +106,3 @@ impl Certificate {
|
|||
Ok(sealedbox::seal(message, pk))
|
||||
}
|
||||
}
|
||||
|
||||
impl <T: AsRef<Path>> From<T> for Certificate {
|
||||
fn from(path: T) -> Self {
|
||||
Certificate::new_from_cbor(&path)
|
||||
.expect(&format!{"Could not read certificate from {}", path.as_ref().display()})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ impl Keyring {
|
|||
where T: AsRef<Path>
|
||||
{
|
||||
Keyring {
|
||||
certificate: Certificate::from(certificate_path),
|
||||
certificate: Certificate::new_from_cbor(certificate_path).unwrap(),
|
||||
known_keys: HashMap::new()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue