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;
mod shared_screen;
use anyhow::{anyhow, bail, Result};
use anyhow::{anyhow, Result};
use async_trait::async_trait;
use audio::Audio;
use call_settings::CallSettings;
@ -14,8 +14,8 @@ use client::{
use collections::HashSet;
use futures::{channel::oneshot, future::Shared, Future, FutureExt};
use gpui::{
AppContext, AsyncAppContext, AsyncWindowContext, Context, EventEmitter, Model, ModelContext,
Subscription, Task, View, ViewContext, VisualContext, WeakModel, WeakView,
AppContext, AsyncAppContext, Context, EventEmitter, Model, ModelContext, Subscription, Task,
View, ViewContext, VisualContext, WeakModel, WeakView,
};
pub use participant::ParticipantLocation;
use postage::watch;
@ -609,7 +609,7 @@ impl CallHandler for Call {
fn room_id(&self, cx: &AppContext) -> Option<u64> {
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 {
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({
let workspace = workspace.clone();
move |_, cx| {
workspace.update(cx, |this, cx| {
workspace
.update(cx, |this, cx| {
this.call_state().hang_up(cx).detach();
});
})
.log_err();
}
})),
)

View file

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