Is it possible to provide a lazy static with lifetime args?
use lazy_static::lazy_static; //lazy_static = "1.4.0"
enum MyEnum<'a>{
Name(&'a str)
}
lazy_static! {
static ref STATIC_ENUM: Mutex<MyEnum<'a>> = Mutex::new(MyEnum::Name("some name"));
}
gives:
error[E0261]: use of undeclared lifetime name `'a`
static ref STATIC_ENUM: Mutex<MyEnum<'a>> = Mutex::new(MyEnum::Name("some name"));
^^ undeclared lifetime