File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
cosmic-applet-status-area/src Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change 55// but only tracking unique names, and using tokio executor.
66
77use futures:: StreamExt ;
8+ use futures:: stream:: FusedStream ;
89use std:: {
910 collections:: HashSet ,
1011 future:: { Future , poll_fn} ,
@@ -36,9 +37,15 @@ impl Inner {
3637 /// Process all events so far on `stream`, and update `unique_names`.
3738 fn update_if_needed ( & mut self ) {
3839 let mut context = Context :: from_waker ( & self . waker ) ;
39- while let Poll :: Ready ( val) = self . stream . poll_next_unpin ( & mut context) {
40- let val = val. unwrap ( ) ;
41- let args = val. args ( ) . unwrap ( ) ;
40+ while !self . stream . is_terminated ( )
41+ && let Poll :: Ready ( val) = self . stream . poll_next_unpin ( & mut context)
42+ {
43+ let Some ( val) = val else {
44+ break ;
45+ } ;
46+ let Ok ( args) = val. args ( ) else {
47+ break ;
48+ } ;
4249 match args. name {
4350 BusName :: Unique ( name) => {
4451 if args. new_owner . is_some ( ) {
@@ -48,7 +55,7 @@ impl Inner {
4855 }
4956 }
5057 BusName :: WellKnown ( _) => { }
51- }
58+ } ;
5259 }
5360 }
5461}
You can’t perform that action at this time.
0 commit comments