use fn_name instead of name_ref.text()

This commit is contained in:
Dorian Scheidt 2022-08-18 18:12:53 -05:00
parent d39677c1eb
commit 6130860789

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().starts_with(char::is_uppercase) {
if fn_name.starts_with(char::is_uppercase) {
return None;
}
}