dtolnay / clang-ast

Deserialization logic for efficiently processing Clang's `-ast-dump=json` format
Apache License 2.0
132 stars 13 forks source link

Support Option<String> as kind field in caller's struct #6

Closed dtolnay closed 3 years ago

dtolnay commented 3 years ago

For example:

pub type Node = clang_ast::Node<Clang>;

#[derive(Deserialize)]
pub struct Clang {
    pub kind: Option<String>,
}

Previously this would fail with a message like invalid type: string "TranslationUnitDecl", expected option.