Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/aqua/standard_registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,14 @@ mod tests {
"aquaproj/aqua-registry"
);
assert!(!AQUA_STANDARD_REGISTRY_METADATA.tag.is_empty());
assert!(AQUA_STANDARD_REGISTRY_METADATA.tag.starts_with('v'));
assert!(
AQUA_STANDARD_REGISTRY_METADATA.tag.starts_with('v')
|| AQUA_STANDARD_REGISTRY_METADATA.tag.len() == 40
&& AQUA_STANDARD_REGISTRY_METADATA
.tag
.chars()
.all(|c| c.is_ascii_hexdigit())
);
Comment on lines +75 to +82

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 The && and || operators sit at the same visual indent level, making the precedence ambiguous at a glance. In Rust && binds tighter than ||, so the logic is correct as written, but an explicit pair of parentheses would make the intent clear to anyone reading the test.

Suggested change
assert!(
AQUA_STANDARD_REGISTRY_METADATA.tag.starts_with('v')
|| AQUA_STANDARD_REGISTRY_METADATA.tag.len() == 40
&& AQUA_STANDARD_REGISTRY_METADATA
.tag
.chars()
.all(|c| c.is_ascii_hexdigit())
);
assert!(
AQUA_STANDARD_REGISTRY_METADATA.tag.starts_with('v')
|| (AQUA_STANDARD_REGISTRY_METADATA.tag.len() == 40
&& AQUA_STANDARD_REGISTRY_METADATA
.tag
.chars()
.all(|c| c.is_ascii_hexdigit()))
);

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Claude Code

}

#[test]
Expand Down
Loading