@@ -55,7 +55,12 @@ impl State {
5555 let start = events_page * PAGE_SIZE ;
5656 let end = ( ( events_page + 1 ) * PAGE_SIZE ) . min ( total_events) ;
5757
58- for event in client. events . iter ( ) . skip ( start) . take ( end - start) {
58+ for event in client
59+ . events
60+ . iter ( )
61+ . skip ( start)
62+ . take ( end. saturating_sub ( start) )
63+ {
5964 let color = event. ui_group_color ( ) ;
6065 stream. push ( UIEvent {
6166 event : SharedString :: from ( event. msg ) ,
@@ -83,7 +88,7 @@ impl State {
8388 let events_total_pages = if max_events_count == 0 {
8489 1
8590 } else {
86- ( max_events_count + PAGE_SIZE - 1 ) / PAGE_SIZE
91+ max_events_count. div_ceil ( PAGE_SIZE )
8792 } ;
8893 ui. set_events_page ( events_page as i32 ) ;
8994 ui. set_events_total_pages ( events_total_pages as i32 ) ;
@@ -128,7 +133,7 @@ impl State {
128133 let groups_total_pages = if total_groups == 0 {
129134 1
130135 } else {
131- ( total_groups + PAGE_SIZE - 1 ) / PAGE_SIZE
136+ total_groups. div_ceil ( PAGE_SIZE )
132137 } ;
133138
134139 let start = groups_page * PAGE_SIZE ;
@@ -139,7 +144,7 @@ impl State {
139144
140145 // Sort epochs by epoch number
141146 let mut epoch_numbers = BTreeSet :: new ( ) ;
142- for ( _inst , epochs) in inst_epochs_map {
147+ for epochs in inst_epochs_map. values ( ) {
143148 epoch_numbers. extend ( epochs. epochs . keys ( ) ) ;
144149 }
145150
@@ -215,7 +220,7 @@ impl State {
215220 } else {
216221 // No epoch data, but still drain outer events if this is the last epoch
217222 if i + 1 == epoch_numbers. len ( ) {
218- while let Some ( event) = outer_events. next ( ) {
223+ for event in outer_events. by_ref ( ) {
219224 ui_states. push ( event. ui_group_state ( ) ) ;
220225 }
221226 }
@@ -390,7 +395,7 @@ impl State {
390395 group_id_short : SharedString :: from ( short_id ( group_id) ) ,
391396 group_color,
392397 installation_rows : ModelRc :: new ( VecModel :: from ( installation_rows) ) ,
393- total_entries : total_entries as i32 ,
398+ total_entries,
394399 total_slots,
395400 } ) ;
396401 }
@@ -434,7 +439,7 @@ impl LogEvent {
434439 . problems
435440 . lock ( )
436441 . iter ( )
437- . map ( |p| SharedString :: from ( p ) )
442+ . map ( SharedString :: from)
438443 . collect ( ) ;
439444
440445 UITimelineEntry {
@@ -459,7 +464,7 @@ impl LogEvent {
459464 . problems
460465 . lock ( )
461466 . iter ( )
462- . map ( |p| SharedString :: from ( p ) )
467+ . map ( SharedString :: from)
463468 . collect ( ) ;
464469
465470 UIGroupState {
@@ -483,7 +488,7 @@ impl GroupState {
483488 . problems
484489 . lock ( )
485490 . iter ( )
486- . map ( |p| SharedString :: from ( p ) )
491+ . map ( SharedString :: from)
487492 . collect ( ) ;
488493
489494 UIGroupState {
@@ -511,7 +516,7 @@ impl GroupState {
511516 . problems
512517 . lock ( )
513518 . iter ( )
514- . map ( |p| SharedString :: from ( p ) )
519+ . map ( SharedString :: from)
515520 . collect ( ) ;
516521
517522 UITimelineEntry {
@@ -538,7 +543,7 @@ impl GroupState {
538543 . problems
539544 . lock ( )
540545 . iter ( )
541- . map ( |p| SharedString :: from ( p ) )
546+ . map ( SharedString :: from)
542547 . collect ( ) ;
543548
544549 UIGroupStateDetail {
0 commit comments