File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
notify-debouncer-full/src Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -275,6 +275,7 @@ impl<T: FileIdCache> DebounceDataInner<T> {
275
275
// get the path of the event
276
276
. map ( |( path, _) | path. clone ( ) )
277
277
{
278
+ // unwraps are safe because only paths for existing queues with at least one event are returned by the query above
278
279
let event = self
279
280
. queues
280
281
. get_mut ( & path)
@@ -301,7 +302,7 @@ impl<T: FileIdCache> DebounceDataInner<T> {
301
302
302
303
events_expired. push ( event) ;
303
304
} else {
304
- self . queues . get_mut ( & path) . unwrap ( ) . events . push_front ( event) ;
305
+ self . queues . get_mut ( & path) . unwrap ( ) . events . push_front ( event) ; // unwrap is safe because only paths for existing queues are returned by the query above
305
306
306
307
break ;
307
308
}
@@ -505,7 +506,7 @@ impl<T: FileIdCache> DebounceDataInner<T> {
505
506
506
507
if let Some ( target_queue) = self . queues . get_mut ( & event. paths [ 0 ] ) {
507
508
if target_queue. was_removed ( ) {
508
- let event = target_queue. events . pop_front ( ) . unwrap ( ) ;
509
+ let event = target_queue. events . pop_front ( ) . unwrap ( ) ; // unwrap is safe because `was_removed` implies that the queue is not empty
509
510
source_queue. events . push_front ( event) ;
510
511
}
511
512
You can’t perform that action at this time.
0 commit comments