chore: Fix several style lints (#17488)

It's not comprehensive enough to start linting on `style` group, but
hey, it's a start.

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2024-09-06 11:58:39 +02:00 committed by GitHub
parent 93249fc82b
commit e6c1c51b37
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
361 changed files with 3530 additions and 3587 deletions

View file

@ -145,7 +145,7 @@ impl InlineCompletionProvider for CopilotCompletionProvider {
};
}
Direction::Next => {
if self.completions.len() == 0 {
if self.completions.is_empty() {
self.active_completion_index = 0
} else {
self.active_completion_index =
@ -221,15 +221,13 @@ impl InlineCompletionProvider for CopilotCompletionProvider {
})
.detach_and_log_err(cx);
if should_report_inline_completion_event {
if self.active_completion().is_some() {
if let Some(telemetry) = self.telemetry.as_ref() {
telemetry.report_inline_completion_event(
Self::name().to_string(),
false,
self.file_extension.clone(),
);
}
if should_report_inline_completion_event && self.active_completion().is_some() {
if let Some(telemetry) = self.telemetry.as_ref() {
telemetry.report_inline_completion_event(
Self::name().to_string(),
false,
self.file_extension.clone(),
);
}
}
}
@ -1148,7 +1146,7 @@ mod tests {
}
fn init_test(cx: &mut TestAppContext, f: fn(&mut AllLanguageSettingsContent)) {
_ = cx.update(|cx| {
cx.update(|cx| {
let store = SettingsStore::test(cx);
cx.set_global(store);
theme::init(theme::LoadThemes::JustBase, cx);