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> {
227227}
228228impl < Key > StatCollect < Key , Arc < SymbolIndex > > for SymbolsStats < Key > {
229229 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+ }
233234 }
234235}
235236
@@ -254,8 +255,7 @@ impl fmt::Display for AttrsStats {
254255
255256impl < Key > StatCollect < Key , Attrs > for AttrsStats {
256257 fn collect_entry ( & mut self , _: Key , value : Option < Attrs > ) {
257- let attrs = value. unwrap ( ) ;
258258 self . entries += 1 ;
259- self . total += attrs . len ( ) ;
259+ self . total += value . map_or ( 0 , |it| it . len ( ) ) ;
260260 }
261261}
You can’t perform that action at this time.
0 commit comments