We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0b3a64e commit 9ad579fCopy full SHA for 9ad579f
exercises/phone-number/example.rs
@@ -3,8 +3,7 @@ pub fn number(user_number: &str) -> Option<String> {
3
4
let number_len = filtered_number.len();
5
6
- if number_len < 10
7
- || number_len > 11
+ if !(10..=11).contains(&number_len)
8
|| (filtered_number.len() == 11 && !filtered_number.starts_with('1'))
9
{
10
return None;
exercises/scale-generator/example.rs
@@ -244,7 +244,7 @@ pub mod note {
244
let mut iter = lc.chars();
245
246
let mut note = match iter.next() {
247
- Some(c) if 'a' <= c && 'g' >= c => Note {
+ Some(c) if ('a'..='g').contains(&c) => Note {
248
tonic: match c {
249
'a' => Root::A,
250
'b' => Root::B,
0 commit comments