Fix a bunch of other low-hanging style lints (#36498)

- **Fix a bunch of low hanging style lints like unnecessary-return**
- **Fix single worktree violation**
- **And the rest**

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2025-08-19 21:26:17 +02:00 committed by GitHub
parent df9c2aefb1
commit 05fc0c432c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
239 changed files with 854 additions and 1015 deletions

View file

@ -147,7 +147,7 @@ impl ActiveCall {
let mut incoming_call = this.incoming_call.0.borrow_mut();
if incoming_call
.as_ref()
.map_or(false, |call| call.room_id == envelope.payload.room_id)
.is_some_and(|call| call.room_id == envelope.payload.room_id)
{
incoming_call.take();
}

View file

@ -64,7 +64,7 @@ pub struct RemoteParticipant {
impl RemoteParticipant {
pub fn has_video_tracks(&self) -> bool {
return !self.video_tracks.is_empty();
!self.video_tracks.is_empty()
}
pub fn can_write(&self) -> bool {

View file

@ -939,8 +939,7 @@ impl Room {
self.client.user_id()
)
})?;
if self.live_kit.as_ref().map_or(true, |kit| kit.deafened) && publication.is_audio()
{
if self.live_kit.as_ref().is_none_or(|kit| kit.deafened) && publication.is_audio() {
publication.set_enabled(false, cx);
}
match track {
@ -1174,7 +1173,7 @@ impl Room {
this.update(cx, |this, cx| {
this.shared_projects.insert(project.downgrade());
let active_project = this.local_participant.active_project.as_ref();
if active_project.map_or(false, |location| *location == project) {
if active_project.is_some_and(|location| *location == project) {
this.set_location(Some(&project), cx)
} else {
Task::ready(Ok(()))
@ -1247,9 +1246,9 @@ impl Room {
}
pub fn is_sharing_screen(&self) -> bool {
self.live_kit.as_ref().map_or(false, |live_kit| {
!matches!(live_kit.screen_track, LocalTrack::None)
})
self.live_kit
.as_ref()
.is_some_and(|live_kit| !matches!(live_kit.screen_track, LocalTrack::None))
}
pub fn shared_screen_id(&self) -> Option<u64> {
@ -1262,13 +1261,13 @@ impl Room {
}
pub fn is_sharing_mic(&self) -> bool {
self.live_kit.as_ref().map_or(false, |live_kit| {
!matches!(live_kit.microphone_track, LocalTrack::None)
})
self.live_kit
.as_ref()
.is_some_and(|live_kit| !matches!(live_kit.microphone_track, LocalTrack::None))
}
pub fn is_muted(&self) -> bool {
self.live_kit.as_ref().map_or(false, |live_kit| {
self.live_kit.as_ref().is_some_and(|live_kit| {
matches!(live_kit.microphone_track, LocalTrack::None)
|| live_kit.muted_by_user
|| live_kit.deafened
@ -1278,13 +1277,13 @@ impl Room {
pub fn muted_by_user(&self) -> bool {
self.live_kit
.as_ref()
.map_or(false, |live_kit| live_kit.muted_by_user)
.is_some_and(|live_kit| live_kit.muted_by_user)
}
pub fn is_speaking(&self) -> bool {
self.live_kit
.as_ref()
.map_or(false, |live_kit| live_kit.speaking)
.is_some_and(|live_kit| live_kit.speaking)
}
pub fn is_deafened(&self) -> Option<bool> {