Remove HashSet::from(...)
This commit is contained in:
parent
47d2307d1f
commit
deb3ee2b23
|
@ -1,6 +1,5 @@
|
||||||
use crate::cst::{Expression, ModuleContext, Tag, Tools};
|
use crate::cst::{Expression, ModuleContext, Tag, Tools};
|
||||||
use json::JsonValue;
|
use json::JsonValue;
|
||||||
use std::collections::HashSet;
|
|
||||||
|
|
||||||
#[allow(unused_imports)]
|
#[allow(unused_imports)]
|
||||||
use log::{debug, error, info, trace, warn};
|
use log::{debug, error, info, trace, warn};
|
||||||
|
@ -15,7 +14,8 @@ impl EventExpressionList {
|
||||||
);
|
);
|
||||||
for json_expression in json_expressions {
|
for json_expression in json_expressions {
|
||||||
let json_children = &json_expression["children"];
|
let json_children = &json_expression["children"];
|
||||||
assert!(HashSet::from([1, 2]).contains(&json_children.len()));
|
assert!(json_children.len() == 1 || json_children.len() == 2);
|
||||||
|
|
||||||
match json_children[0]["tag"].as_str() {
|
match json_children[0]["tag"].as_str() {
|
||||||
Some(Tag::POS_EDGE) => Expression::codegen(&json_children[1], context),
|
Some(Tag::POS_EDGE) => Expression::codegen(&json_children[1], context),
|
||||||
Some(Tag::NEG_EDGE) => Expression::codegen(&json_children[1], context),
|
Some(Tag::NEG_EDGE) => Expression::codegen(&json_children[1], context),
|
||||||
|
|
|
@ -374,7 +374,7 @@ impl ModuleDeclaration {
|
||||||
|
|
||||||
fn get_var_width(json: &JsonValue, dim_path: Vec<&str>) -> usize {
|
fn get_var_width(json: &JsonValue, dim_path: Vec<&str>) -> usize {
|
||||||
let json_dims = Tools::match_tags(vec![json], dim_path);
|
let json_dims = Tools::match_tags(vec![json], dim_path);
|
||||||
assert!(HashSet::from([0, 2]).contains(&json_dims.len()));
|
assert!(json_dims.len() == 0 || json_dims.len() == 2);
|
||||||
|
|
||||||
match json_dims.len() {
|
match json_dims.len() {
|
||||||
2 => {
|
2 => {
|
||||||
|
|
Loading…
Reference in New Issue