dtolnay / inventory

Typed distributed plugin registration
Apache License 2.0
948 stars 43 forks source link

Missing `const` in doc #53

Closed Rayzeq closed 1 year ago

Rayzeq commented 1 year ago

In the example in the doc there is this function:

impl Flag {
    pub fn new(short: char, name: &'static str) -> Self {
        Flag { short, name }
    }
}

But it fail compiling with this error: error[E0015]: cannot call non-const fn 'Flag::new' in statics. The example file works fine because it uses const fn new