Skip to content

Commit 8e19603

Browse files
rbradfordlauralt
authored andcommitted
writer: Update for new clippy check (ascii range check)
I also went further and node_name_valid_char() to use an appropriate helper function. Signed-off-by: Rob Bradford <[email protected]>
1 parent 3709ca6 commit 8e19603

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/writer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,11 @@ fn node_name_valid(name: &str) -> bool {
198198
}
199199

200200
fn node_name_valid_char(c: char) -> bool {
201-
matches!(c, '0'..='9' | 'a'..='z' | 'A'..='Z' | ',' | '.' | '_' | '+' | '-')
201+
c.is_ascii_alphanumeric() || matches!(c, ',' | '.' | '_' | '+' | '-')
202202
}
203203

204204
fn node_name_valid_first_char(c: char) -> bool {
205-
matches!(c, 'a'..='z' | 'A'..='Z')
205+
c.is_ascii_alphabetic()
206206
}
207207

208208
// Check if `name` is a valid property name.

0 commit comments

Comments
 (0)