Fix some more warnings

This commit is contained in:
Piotr Osiewicz 2023-11-27 15:49:47 +01:00
parent 30af3ffaf3
commit 8ca9f4e12a
3 changed files with 10 additions and 10 deletions

View file

@ -3,7 +3,7 @@ pub mod participant;
pub mod room; pub mod room;
mod shared_screen; mod shared_screen;
use anyhow::{anyhow, bail, Result}; use anyhow::{anyhow, Result};
use async_trait::async_trait; use async_trait::async_trait;
use audio::Audio; use audio::Audio;
use call_settings::CallSettings; use call_settings::CallSettings;
@ -14,8 +14,8 @@ use client::{
use collections::HashSet; use collections::HashSet;
use futures::{channel::oneshot, future::Shared, Future, FutureExt}; use futures::{channel::oneshot, future::Shared, Future, FutureExt};
use gpui::{ use gpui::{
AppContext, AsyncAppContext, AsyncWindowContext, Context, EventEmitter, Model, ModelContext, AppContext, AsyncAppContext, Context, EventEmitter, Model, ModelContext, Subscription, Task,
Subscription, Task, View, ViewContext, VisualContext, WeakModel, WeakView, View, ViewContext, VisualContext, WeakModel, WeakView,
}; };
pub use participant::ParticipantLocation; pub use participant::ParticipantLocation;
use postage::watch; use postage::watch;
@ -609,7 +609,7 @@ impl CallHandler for Call {
fn room_id(&self, cx: &AppContext) -> Option<u64> { fn room_id(&self, cx: &AppContext) -> Option<u64> {
Some(self.active_call.as_ref()?.0.read(cx).room()?.read(cx).id()) Some(self.active_call.as_ref()?.0.read(cx).room()?.read(cx).id())
} }
fn hang_up(&self, mut cx: &mut AppContext) -> Task<Result<()>> { fn hang_up(&self, cx: &mut AppContext) -> Task<Result<()>> {
let Some((call, _)) = self.active_call.as_ref() else { let Some((call, _)) = self.active_call.as_ref() else {
return Task::ready(Err(anyhow!("Cannot exit a call; not in a call"))); return Task::ready(Err(anyhow!("Cannot exit a call; not in a call")));
}; };

View file

@ -233,9 +233,11 @@ impl Render for CollabTitlebarItem {
.child(IconButton::new("leave-call", ui::Icon::Exit).on_click({ .child(IconButton::new("leave-call", ui::Icon::Exit).on_click({
let workspace = workspace.clone(); let workspace = workspace.clone();
move |_, cx| { move |_, cx| {
workspace.update(cx, |this, cx| { workspace
this.call_state().hang_up(cx).detach(); .update(cx, |this, cx| {
}); this.call_state().hang_up(cx).detach();
})
.log_err();
} }
})), })),
) )

View file

@ -1,8 +1,6 @@
use gpui::{ use gpui::{
div, AnyElement, Div, IntoElement as _, ParentElement as _, Render, RenderOnce, Styled, div, AnyElement, Div, IntoElement as _, ParentElement as _, RenderOnce, Styled, WindowContext,
ViewContext, WindowContext,
}; };
use ui::Avatar;
#[derive(Default)] #[derive(Default)]
pub(crate) struct FacePile { pub(crate) struct FacePile {