Better lowercase/uppercase checks

This commit is contained in:
Amos Wenger 2022-05-22 18:31:12 +02:00
parent 707a5683b1
commit 796c4d8a10
2 changed files with 2 additions and 2 deletions

View file

@ -73,7 +73,7 @@ fn gen_fn(acc: &mut Assists, ctx: &AssistContext) -> Option<()> {
Some(hir::PathResolution::Def(hir::ModuleDef::Adt(adt))) => {
if let hir::Adt::Enum(_) = adt {
// Don't suggest generating function if the name starts with an uppercase letter
if name_ref.text().chars().next()?.is_uppercase() {
if name_ref.text().starts_with(char::is_uppercase) {
return None;
}
}