Skip to content

Commit

Permalink
perf(audit): remove extra key check
Browse files Browse the repository at this point in the history
  • Loading branch information
j-mendez committed Mar 21, 2024
1 parent 1dcbfaf commit 65760e8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion accessibility-rs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "accessibility-rs"
version = "0.0.50"
version = "0.0.51"
authors = ["The A11yWatch Project Developers", "Jeff Mendez <[email protected]>"]
edition = "2021"
license = "MIT OR Apache-2.0"
Expand Down
32 changes: 13 additions & 19 deletions accessibility-rs/src/engine/audit/wcag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,28 +45,22 @@ impl WCAGAAA {
let mut issues: Vec<Issue> = Vec::new();

for node in auditor.tree.clone().iter() {
if RULES_A.contains_key(&*node.0) {
match RULES_A.get(&*node.0) {
Some(rules) => {
for rule in rules {
match (rule.validate)(&node.1, &mut auditor) {
RuleValidation::Single(validation) => push_issue(
validation,
rule,
&node.0,
&auditor.locale,
&mut issues,
),
RuleValidation::Multi(validation) => {
for v in validation {
push_issue(v, rule, &node.0, &auditor.locale, &mut issues)
}
match RULES_A.get(&*node.0) {
Some(rules) => {
for rule in rules {
match (rule.validate)(&node.1, &mut auditor) {
RuleValidation::Single(validation) => {
push_issue(validation, rule, &node.0, &auditor.locale, &mut issues)
}
RuleValidation::Multi(validation) => {
for v in validation {
push_issue(v, rule, &node.0, &auditor.locale, &mut issues)
}
};
}
}
};
}
_ => (),
}
_ => (),
}
}

Expand Down

0 comments on commit 65760e8

Please sign in to comment.