chore: Another round of style lints fixes (#17519)

Closes #ISSUE

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2024-09-07 02:36:55 +02:00 committed by GitHub
parent cfd43572c1
commit 095a08d9c8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
33 changed files with 67 additions and 82 deletions

View file

@ -329,7 +329,7 @@ impl AssistantPanel {
cx: &mut ViewContext<Self>,
) -> Self {
let model_selector_menu_handle = PopoverMenuHandle::default();
let model_summary_editor = cx.new_view(|cx| Editor::single_line(cx));
let model_summary_editor = cx.new_view(Editor::single_line);
let context_editor_toolbar = cx.new_view(|_| {
ContextEditorToolbarItem::new(
workspace,
@ -1097,7 +1097,7 @@ impl AssistantPanel {
pane.activate_item(configuration_item_ix, true, true, cx);
});
} else {
let configuration = cx.new_view(|cx| ConfigurationView::new(cx));
let configuration = cx.new_view(ConfigurationView::new);
self.configuration_subscription = Some(cx.subscribe(
&configuration,
|this, _, event: &ConfigurationViewEvent, cx| match event {
@ -4222,8 +4222,7 @@ impl Item for ContextEditor {
}
fn deactivated(&mut self, cx: &mut ViewContext<Self>) {
self.editor
.update(cx, |editor, cx| Item::deactivated(editor, cx))
self.editor.update(cx, Item::deactivated)
}
}

View file

@ -700,7 +700,7 @@ impl Context {
telemetry: Option<Arc<Telemetry>>,
cx: &mut ModelContext<Self>,
) -> Self {
let id = saved_context.id.clone().unwrap_or_else(|| ContextId::new());
let id = saved_context.id.clone().unwrap_or_else(ContextId::new);
let mut this = Self::new(
id,
ReplicaId::default(),

View file

@ -390,7 +390,7 @@ impl ContextStore {
context_proto
.operations
.into_iter()
.map(|op| ContextOperation::from_proto(op))
.map(ContextOperation::from_proto)
.collect::<Result<Vec<_>>>()
})
.await?;
@ -527,7 +527,7 @@ impl ContextStore {
context_proto
.operations
.into_iter()
.map(|op| ContextOperation::from_proto(op))
.map(ContextOperation::from_proto)
.collect::<Result<Vec<_>>>()
})
.await?;

View file

@ -3073,7 +3073,7 @@ mod tests {
codegen.handle_stream(
String::new(),
range,
future::ready(Ok(chunks_rx.map(|chunk| Ok(chunk)).boxed())),
future::ready(Ok(chunks_rx.map(Ok).boxed())),
cx,
)
});
@ -3145,7 +3145,7 @@ mod tests {
codegen.handle_stream(
String::new(),
range.clone(),
future::ready(Ok(chunks_rx.map(|chunk| Ok(chunk)).boxed())),
future::ready(Ok(chunks_rx.map(Ok).boxed())),
cx,
)
});
@ -3220,7 +3220,7 @@ mod tests {
codegen.handle_stream(
String::new(),
range.clone(),
future::ready(Ok(chunks_rx.map(|chunk| Ok(chunk)).boxed())),
future::ready(Ok(chunks_rx.map(Ok).boxed())),
cx,
)
});
@ -3294,7 +3294,7 @@ mod tests {
codegen.handle_stream(
String::new(),
range.clone(),
future::ready(Ok(chunks_rx.map(|chunk| Ok(chunk)).boxed())),
future::ready(Ok(chunks_rx.map(Ok).boxed())),
cx,
)
});

View file

@ -253,7 +253,7 @@ fn tab_items_for_queries(
.fold(HashMap::default(), |mut candidates, (id, path_string)| {
candidates
.entry(path_string)
.or_insert_with(|| Vec::new())
.or_insert_with(Vec::new)
.push(id);
candidates
});