@@ -110,15 +110,9 @@ impl DashboardBuilder {
110110 let entity_id = parts[ 1 ] . to_string ( ) ;
111111
112112 if entity_type_str == "User" {
113- user_stats_map
114- . entry ( entity_id)
115- . or_default ( )
116- . push ( stat) ;
113+ user_stats_map. entry ( entity_id) . or_default ( ) . push ( stat) ;
117114 } else if entity_type_str == "Agent" {
118- agent_stats_map
119- . entry ( entity_id)
120- . or_default ( )
121- . push ( stat) ;
115+ agent_stats_map. entry ( entity_id) . or_default ( ) . push ( stat) ;
122116 }
123117 }
124118 }
@@ -157,11 +151,7 @@ impl DashboardBuilder {
157151 let summary = self . build_summary ( & user_stats, & agent_stats, & history) ;
158152
159153 // Get recent history (last 100 records)
160- let recent_history: Vec < UsageRecord > = history
161- . into_iter ( )
162- . rev ( )
163- . take ( 100 )
164- . collect ( ) ;
154+ let recent_history: Vec < UsageRecord > = history. into_iter ( ) . rev ( ) . take ( 100 ) . collect ( ) ;
165155
166156 DashboardData {
167157 timestamp : chrono:: Utc :: now ( ) ,
@@ -218,10 +208,7 @@ impl DashboardBuilder {
218208 }
219209 }
220210
221- let rate_limited_count = history
222- . iter ( )
223- . filter ( |r| !r. success )
224- . count ( ) as u64 ;
211+ let rate_limited_count = history. iter ( ) . filter ( |r| !r. success ) . count ( ) as u64 ;
225212
226213 let avg_utilization_percent = if quota_count > 0 {
227214 total_utilization / quota_count as f64
@@ -435,4 +422,4 @@ mod tests {
435422 assert_eq ! ( parsed. entity_id, "user-123" ) ;
436423 assert_eq ! ( parsed. entity_type, EntityType :: User ) ;
437424 }
438- }
425+ }
0 commit comments