arraygen 0.3.2

Derive macro for generating arrays from struct fields.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
pub trait OptionExtensions<T> {
    fn insert_stable(&mut self, value: T) -> &mut T;
}

impl<T> OptionExtensions<T> for Option<T> {
    fn insert_stable(&mut self, value: T) -> &mut T {
        *self = Some(value);
        match self {
            Some(value) => value,
            None => unreachable!(),
        }
    }
}