fixedvec-rs icon indicating copy to clipboard operation
fixedvec-rs copied to clipboard

Can't use FixedVec type in lazy_static

Open ethindp opened this issue 6 years ago • 0 comments

I am attempting to declare a FixedVec in a lazy_static! declaration. However, I repeatedly keep getting error 0106. I have tried various ways of initializing it; right now I have this code:

static SPACE: [(Option::<char>, Option::<KeyCode>); 512] = {
    alloc_stack!([(Option::<char>, Option::<KeyCode>); 512])
};

And then this:

lazy_static! {
    static ref KEY_QUEUE: Mutex<FixedVec> =
        Mutex::new(FixedVec::new(SPACE));
//...

However, this does not seem to work. I have tried declaring the type that the vec will hold as though I were declaring a normal Vec<>, however tha didn't work either. How exactly would I go about this?

ethindp avatar Dec 07 '19 03:12 ethindp