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

@ -219,7 +219,7 @@ impl CollabPanel {
})
.detach();
let channel_name_editor = cx.new_view(|cx| Editor::single_line(cx));
let channel_name_editor = cx.new_view(Editor::single_line);
cx.subscribe(&channel_name_editor, |this: &mut Self, _, event, cx| {
if let editor::EditorEvent::Blurred = event {
@ -328,7 +328,7 @@ impl CollabPanel {
panel.width = serialized_panel.width.map(|w| w.round());
panel.collapsed_channels = serialized_panel
.collapsed_channels
.unwrap_or_else(|| Vec::new())
.unwrap_or_else(Vec::new)
.iter()
.map(|cid| ChannelId(*cid))
.collect();
@ -955,7 +955,7 @@ impl CollabPanel {
}
fn take_editing_state(&mut self, cx: &mut ViewContext<Self>) -> bool {
if let Some(_) = self.channel_editing_state.take() {
if self.channel_editing_state.take().is_some() {
self.channel_name_editor.update(cx, |editor, cx| {
editor.set_text("", cx);
});
@ -1850,8 +1850,7 @@ impl CollabPanel {
if let Some(contact) = self.selected_contact() {
self.deploy_contact_context_menu(bounds.center(), contact, cx);
cx.stop_propagation();
return;
};
}
}
fn selected_channel(&self) -> Option<&Arc<Channel>> {
@ -2142,7 +2141,7 @@ impl CollabPanel {
} => self
.render_participant_project(
*project_id,
&worktree_root_names,
worktree_root_names,
*host_user_id,
*is_last,
is_selected,
@ -2401,7 +2400,7 @@ impl CollabPanel {
) -> impl IntoElement {
let github_login = SharedString::from(user.github_login.clone());
let user_id = user.id;
let is_response_pending = self.user_store.read(cx).is_contact_request_pending(&user);
let is_response_pending = self.user_store.read(cx).is_contact_request_pending(user);
let color = if is_response_pending {
Color::Muted
} else {
@ -2457,7 +2456,7 @@ impl CollabPanel {
let response_is_pending = self
.channel_store
.read(cx)
.has_pending_channel_invite_response(&channel);
.has_pending_channel_invite_response(channel);
let color = if response_is_pending {
Color::Muted
} else {
@ -2832,7 +2831,7 @@ impl Panel for CollabPanel {
fn icon(&self, cx: &gpui::WindowContext) -> Option<ui::IconName> {
CollaborationPanelSettings::get_global(cx)
.button
.then(|| ui::IconName::Collab)
.then_some(ui::IconName::Collab)
}
fn icon_tooltip(&self, _cx: &WindowContext) -> Option<&'static str> {