File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -227,9 +227,10 @@ impl fmt::Display for SymbolsStats<SourceRootId> {
227
227
}
228
228
impl < Key > StatCollect < Key , Arc < SymbolIndex > > for SymbolsStats < Key > {
229
229
fn collect_entry ( & mut self , _: Key , value : Option < Arc < SymbolIndex > > ) {
230
- let symbols = value. unwrap ( ) ;
231
- self . total += symbols. len ( ) ;
232
- self . size += symbols. memory_size ( ) ;
230
+ if let Some ( symbols) = value {
231
+ self . total += symbols. len ( ) ;
232
+ self . size += symbols. memory_size ( ) ;
233
+ }
233
234
}
234
235
}
235
236
@@ -254,8 +255,7 @@ impl fmt::Display for AttrsStats {
254
255
255
256
impl < Key > StatCollect < Key , Attrs > for AttrsStats {
256
257
fn collect_entry ( & mut self , _: Key , value : Option < Attrs > ) {
257
- let attrs = value. unwrap ( ) ;
258
258
self . entries += 1 ;
259
- self . total += attrs . len ( ) ;
259
+ self . total += value . map_or ( 0 , |it| it . len ( ) ) ;
260
260
}
261
261
}
You can’t perform that action at this time.
0 commit comments