@@ -166,8 +166,7 @@ impl RoomList {
166166 // So the sync is done after the machine _has entered_ into a new state.
167167 loop {
168168 let next_state = self . state. get( ) . next( & self . sliding_sync) . await ?;
169-
170- Observable :: set( & self . state, next_state) ;
169+ self . state. set( next_state) ;
171170
172171 match sync. next( ) . await {
173172 Some ( Ok ( _update_summary) ) => {
@@ -176,8 +175,7 @@ impl RoomList {
176175
177176 Some ( Err ( error) ) => {
178177 let next_state = State :: Terminated { from: Box :: new( self . state. get( ) ) } ;
179-
180- Observable :: set( & self . state, next_state) ;
178+ self . state. set( next_state) ;
181179
182180 yield Err ( Error :: SlidingSync ( error) ) ;
183181
@@ -186,8 +184,7 @@ impl RoomList {
186184
187185 None => {
188186 let next_state = State :: Terminated { from: Box :: new( self . state. get( ) ) } ;
189-
190- Observable :: set( & self . state, next_state) ;
187+ self . state. set( next_state) ;
191188
192189 break ;
193190 }
@@ -198,7 +195,7 @@ impl RoomList {
198195
199196 /// Get a subscriber to the state.
200197 pub fn state ( & self ) -> Subscriber < State > {
201- Observable :: subscribe ( & self . state )
198+ self . state . subscribe ( )
202199 }
203200
204201 /// Get all previous room list entries, in addition to a [`Stream`] to room
0 commit comments