mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
use fn_name instead of name_ref.text()
This commit is contained in:
parent
d39677c1eb
commit
6130860789
1 changed files with 1 additions and 1 deletions
|
@ -73,7 +73,7 @@ fn gen_fn(acc: &mut Assists, ctx: &AssistContext<'_>) -> Option<()> {
|
||||||
Some(hir::PathResolution::Def(hir::ModuleDef::Adt(adt))) => {
|
Some(hir::PathResolution::Def(hir::ModuleDef::Adt(adt))) => {
|
||||||
if let hir::Adt::Enum(_) = adt {
|
if let hir::Adt::Enum(_) = adt {
|
||||||
// Don't suggest generating function if the name starts with an uppercase letter
|
// 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;
|
return None;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue