mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Better lowercase/uppercase checks
This commit is contained in:
parent
707a5683b1
commit
796c4d8a10
2 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue