We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 495aba9 commit 90354d3Copy full SHA for 90354d3
exercises/robot-name/tests/robot-name.rs
@@ -3,11 +3,11 @@ use robot_name as robot;
3
fn assert_name_matches_pattern(n: &str) {
4
assert!(n.len() == 5, "name is exactly 5 characters long");
5
assert!(
6
- n[0..2].chars().all(|c| c >= 'A' && c <= 'Z'),
+ n[0..2].chars().all(|c| ('A'..='Z').contains(&c)),
7
"name starts with 2 uppercase letters"
8
);
9
10
- n[2..].chars().all(|c| c >= '0' && c <= '9'),
+ n[2..].chars().all(|c| ('0'..='9').contains(&c)),
11
"name ends with 3 numbers"
12
13
}
0 commit comments