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

@ -307,7 +307,7 @@ impl SupermavenAgent {
break;
}
}
return anyhow::Ok(());
anyhow::Ok(())
}
})
.detach();
@ -355,7 +355,7 @@ impl SupermavenAgent {
let Some(line) = line.strip_prefix(MESSAGE_PREFIX) else {
continue;
};
let Some(message) = serde_json::from_str::<SupermavenMessage>(&line)
let Some(message) = serde_json::from_str::<SupermavenMessage>(line)
.with_context(|| format!("failed to deserialize line from stdout: {:?}", line))
.log_err()
else {

View file

@ -119,15 +119,13 @@ impl InlineCompletionProvider for SupermavenCompletionProvider {
should_report_inline_completion_event: bool,
_cx: &mut ModelContext<Self>,
) {
if should_report_inline_completion_event {
if self.completion_id.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.completion_id.is_some() {
if let Some(telemetry) = self.telemetry.as_ref() {
telemetry.report_inline_completion_event(
Self::name().to_string(),
false,
self.file_extension.clone(),
);
}
}
@ -163,7 +161,7 @@ impl InlineCompletionProvider for SupermavenCompletionProvider {
}
fn trim_to_end_of_line_unless_leading_newline(text: &str) -> &str {
if has_leading_newline(&text) {
if has_leading_newline(text) {
text
} else if let Some(i) = text.find('\n') {
&text[..i]