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 3da4c28
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +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 {
return None;
}
asname.chars().skip(1).next()?;

if helpers::is_camelcase(name)
&& !str::is_cased_lowercase(asname)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +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 {
return None;
}
name.chars().skip(1).next()?;

if str::is_cased_uppercase(name) && !str::is_cased_uppercase(asname) {
// Ignore any explicitly-allowed names.
Expand Down

0 comments on commit 3da4c28

Please sign in to comment.