nz_21
nz_21

Reputation: 7403

Specifying lifetimes in macro derives

How does one specify lifetimes on macro derives?

#[derive(ElasticType, Serialize, Deserialize)]
pub struct Xkcd<'a> {
       link: &'a str
}

Error example:

#[derive(ElasticType, Serialize, Deserialize)]
 |       ^^^^^^^^^^^ expected lifetime parameter

Upvotes: 0

Views: 400

Answers (1)

Richard
Richard

Reputation: 1177

In your piece of code you simply can not fix this issue. It's a bug in the crate providing #[derive(ElasticType)].

File a bug with the author of ElasticType! If it's not possible for some reason to add support for lifetimed struct it should at least emit a useful error message stating so.

Upvotes: 2

Related Questions