mirror of
https://github.com/chatmail/core.git
synced 2026-05-03 13:26:28 +03:00
refactor: un-resultify KeyPair::new()
It never fails. Clippy did not complain, likely because the function is marked as public.
This commit is contained in:
@@ -80,9 +80,9 @@ impl KeyPair {
|
|||||||
/// Creates new keypair from a secret key.
|
/// Creates new keypair from a secret key.
|
||||||
///
|
///
|
||||||
/// Public key is split off the secret key.
|
/// Public key is split off the secret key.
|
||||||
pub fn new(secret: SignedSecretKey) -> Result<Self> {
|
pub fn new(secret: SignedSecretKey) -> Self {
|
||||||
let public = secret.to_public_key();
|
let public = secret.to_public_key();
|
||||||
Ok(Self { public, secret })
|
Self { public, secret }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -135,7 +135,7 @@ pub(crate) fn create_keypair(addr: EmailAddress) -> Result<KeyPair> {
|
|||||||
.verify_bindings()
|
.verify_bindings()
|
||||||
.context("Invalid secret key generated")?;
|
.context("Invalid secret key generated")?;
|
||||||
|
|
||||||
let key_pair = KeyPair::new(secret_key)?;
|
let key_pair = KeyPair::new(secret_key);
|
||||||
key_pair
|
key_pair
|
||||||
.public
|
.public
|
||||||
.verify_bindings()
|
.verify_bindings()
|
||||||
|
|||||||
Reference in New Issue
Block a user