pintariching/rustle

Fix boolean_attributes.rs

Closed this issue · 1 comments

pub const boolean_attributes: HashSet<&str> = HashSet::from([
    "allowfullscreen",
    "allowpaymentrequest",
    "async",
    "autofocus",
    "autoplay",
    "checked",
    "controls",
    "default",
    "defer",
    "disabled",
    "formnovalidate",
    "hidden",
    "ismap",
    "loop",
    "multiple",
    "muted",
    "nomodule",
    "novalidate",
    "open",
    "playsinline",
    "readonly",
    "required",
    "reversed",
    "selected",
]);

causes the error

cannot call non-const fn `<HashSet<&str> as From<[&str; 24]>>::from` in constants
calls in constants are limited to constant functions, tuple structs and tuple variants

My suggestion for a fix is to make boolean_attributes a static

Fixed