fix(solc): emit empty node vec (#1793)
This commit is contained in:
parent
98cea53c38
commit
a9dd53da81
|
@ -570,9 +570,9 @@ impl BlockNumber {
|
||||||
pub fn is_finalized(&self) -> bool {
|
pub fn is_finalized(&self) -> bool {
|
||||||
matches!(self, BlockNumber::Finalized)
|
matches!(self, BlockNumber::Finalized)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns `true` if it's "safe"
|
/// Returns `true` if it's "safe"
|
||||||
pub fn is_safe(&self) -> bool {
|
pub fn is_safe(&self) -> bool {
|
||||||
matches!(self, BlockNumber::Safe)
|
matches!(self, BlockNumber::Safe)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ pub struct Ast {
|
||||||
pub node_type: NodeType,
|
pub node_type: NodeType,
|
||||||
#[serde(with = "serde_helpers::display_from_str")]
|
#[serde(with = "serde_helpers::display_from_str")]
|
||||||
pub src: SourceLocation,
|
pub src: SourceLocation,
|
||||||
#[serde(default, skip_serializing_if = "Vec::is_empty")]
|
#[serde(default)]
|
||||||
pub nodes: Vec<Node>,
|
pub nodes: Vec<Node>,
|
||||||
|
|
||||||
/// Node attributes that were not deserialized.
|
/// Node attributes that were not deserialized.
|
||||||
|
@ -39,7 +39,7 @@ pub struct Node {
|
||||||
pub src: SourceLocation,
|
pub src: SourceLocation,
|
||||||
|
|
||||||
/// Child nodes for some node types.
|
/// Child nodes for some node types.
|
||||||
#[serde(default, skip_serializing_if = "Vec::is_empty")]
|
#[serde(default)]
|
||||||
pub nodes: Vec<Node>,
|
pub nodes: Vec<Node>,
|
||||||
|
|
||||||
/// Body node for some node types.
|
/// Body node for some node types.
|
||||||
|
|
Loading…
Reference in New Issue