Skip to main content

literal_default

Function literal_default 

pub fn literal_default(
    inner: &str,
    ty: &TypeRef,
    enum_decl: Option<&EnumDecl>,
) -> Result<LiteralDefault, String>
Expand description

Interpret inner, the text of @default(inner), as a literal for a field of type ty. enum_decl is the field’s enum, when it has one. The error says why the literal does not fit.