Skip to content

Commit

Permalink
don't rely on compiler optimisation
Browse files Browse the repository at this point in the history
  • Loading branch information
snowdrop4 committed Nov 25, 2024
1 parent 3bd7fd2 commit 22e8b0a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pub(crate) fn camelcase_imported_as_constant(
ignore_names: &IgnoreNames,
) -> Option<Diagnostic> {
// Single-character names are ambiguous. It could be a class or a constant.
if asname.chars().count() == 1 {
if asname.chars().skip(1).next().is_none() {
return None;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub(crate) fn constant_imported_as_non_constant(
ignore_names: &IgnoreNames,
) -> Option<Diagnostic> {
// Single-character names are ambiguous. It could be a class or a constant.
if name.chars().count() == 1 {
if name.chars().skip(1).next().is_none() {
return None;
}

Expand Down

0 comments on commit 22e8b0a

Please sign in to comment.