Skip to content

Commit

Permalink
fix: make ast node ids optional (gakonst#1254)
Browse files Browse the repository at this point in the history
  • Loading branch information
onbjerg authored May 12, 2022
1 parent 4ba8adf commit 1e2b029
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ethers-solc/src/artifacts/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ pub struct Ast {
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct Node {
/// The node ID.
pub id: usize,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<usize>,

/// The node type.
#[serde(rename = "nodeType")]
Expand Down

0 comments on commit 1e2b029

Please sign in to comment.