Hey everyone,
I have following impl:
impl KeyPair {
pub fn new_key_pair() -> Result<Self, Error> {
let (pub_sign_, sec_sign_) = gen_sign_keypair();
let keypair = Self {
pub_sign: pub_sign_,
sec_sign: sec_sign_,
};
Ok(keypair)
}
}
But because of the dynamic error type it outputs following error message:
error[E0277]: the size for values of type `(dyn error::Error + 'static)` cannot be known at compilation time
--> src/lib.rs:19:5
|
19 | / pub fn new_key_pair() -> Result<Self, Error> {
20 | | let (pub_sign_, sec_sign_) = gen_sign_keypair();
21 | | let keypair = Self {
22 | | pub_sign: pub_sign_,
... |
26 | | Ok(keypair)
27 | | }
| |_____^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `(dyn error::Error + 'static)`
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized>
= note: required by `std::result::Result`
What do I need to do?
Thanks!