Fix warnings in people_panel

This commit is contained in:
Max Brunsfeld
2021-09-20 15:45:41 -07:00
parent 8f578e7521
commit 8b1a2c8cd2
+8 -7
View File
@@ -1,17 +1,18 @@
use gpui::{
elements::*, Element, ElementBox, Entity, ModelHandle, RenderContext, View, ViewContext,
};
use postage::watch;
use crate::{ use crate::{
theme::Theme, theme::Theme,
user::{Collaborator, UserStore}, user::{Collaborator, UserStore},
Settings, Settings,
}; };
use gpui::{
elements::*, Element, ElementBox, Entity, ModelHandle, RenderContext, Subscription, View,
ViewContext,
};
use postage::watch;
pub struct PeoplePanel { pub struct PeoplePanel {
collaborators: ListState, collaborators: ListState,
user_store: ModelHandle<UserStore>, user_store: ModelHandle<UserStore>,
_maintain_collaborators: Subscription,
} }
impl PeoplePanel { impl PeoplePanel {
@@ -20,7 +21,6 @@ impl PeoplePanel {
settings: watch::Receiver<Settings>, settings: watch::Receiver<Settings>,
cx: &mut ViewContext<Self>, cx: &mut ViewContext<Self>,
) -> Self { ) -> Self {
cx.observe(&user_store, Self::update_collaborators);
Self { Self {
collaborators: ListState::new( collaborators: ListState::new(
user_store.read(cx).collaborators().len(), user_store.read(cx).collaborators().len(),
@@ -35,6 +35,7 @@ impl PeoplePanel {
} }
}, },
), ),
_maintain_collaborators: cx.observe(&user_store, Self::update_collaborators),
user_store, user_store,
} }
} }
@@ -108,7 +109,7 @@ impl View for PeoplePanel {
"PeoplePanel" "PeoplePanel"
} }
fn render(&mut self, cx: &mut RenderContext<Self>) -> ElementBox { fn render(&mut self, _: &mut RenderContext<Self>) -> ElementBox {
List::new(self.collaborators.clone()).boxed() List::new(self.collaborators.clone()).boxed()
} }
} }