@@ -390,7 +390,8 @@ impl Context {
390390 // =============================================================================================
391391
392392 let watched_folders = get_watched_folder_configs ( self ) . await ?;
393- ret += & format ! ( "<h3>{}</h3><ul>" , stock_str:: incoming_messages( self ) . await ) ;
393+ let incoming_messages = stock_str:: incoming_messages ( self ) . await ;
394+ ret += & format ! ( "<h3>{}</h3><ul>" , incoming_messages) ;
394395 for ( folder, state) in & folders_states {
395396 let mut folder_added = false ;
396397
@@ -432,10 +433,8 @@ impl Context {
432433 // Your last message was sent successfully
433434 // =============================================================================================
434435
435- ret += & format ! (
436- "<h3>{}</h3><ul><li>" ,
437- stock_str:: outgoing_messages( self ) . await
438- ) ;
436+ let outgoing_messages = stock_str:: outgoing_messages ( self ) . await ;
437+ ret += & format ! ( "<h3>{}</h3><ul><li>" , outgoing_messages) ;
439438 let detailed = smtp. get_detailed ( ) . await ;
440439 ret += & * detailed. to_icon ( ) ;
441440 ret += " " ;
@@ -450,10 +449,8 @@ impl Context {
450449 // =============================================================================================
451450
452451 let domain = tools:: EmailAddress :: new ( & self . get_primary_self_addr ( ) . await ?) ?. domain ;
453- ret += & format ! (
454- "<h3>{}</h3><ul>" ,
455- stock_str:: storage_on_domain( self , domain) . await
456- ) ;
452+ let storage_on_domain = stock_str:: storage_on_domain ( self , domain) . await ;
453+ ret += & format ! ( "<h3>{}</h3><ul>" , storage_on_domain) ;
457454 let quota = self . quota . read ( ) . await ;
458455 if let Some ( quota) = & * quota {
459456 match & quota. recent {
@@ -473,30 +470,23 @@ impl Context {
473470 info ! ( self , "connectivity: root name hidden: \" {}\" " , root_name) ;
474471 }
475472
473+ let messages = stock_str:: messages ( self ) . await ;
474+ let part_of_total_used = stock_str:: part_of_total_used (
475+ self ,
476+ resource. usage . to_string ( ) ,
477+ resource. limit . to_string ( ) ,
478+ )
479+ . await ;
476480 ret += & match & resource. name {
477481 Atom ( resource_name) => {
478482 format ! (
479483 "<b>{}:</b> {}" ,
480484 & * escaper:: encode_minimal( resource_name) ,
481- stock_str:: part_of_total_used(
482- self ,
483- resource. usage. to_string( ) ,
484- resource. limit. to_string( )
485- )
486- . await ,
485+ part_of_total_used
487486 )
488487 }
489488 Message => {
490- format ! (
491- "<b>{}:</b> {}" ,
492- stock_str:: messages( self ) . await ,
493- stock_str:: part_of_total_used(
494- self ,
495- resource. usage. to_string( ) ,
496- resource. limit. to_string( )
497- )
498- . await ,
499- )
489+ format ! ( "<b>{}:</b> {}" , part_of_total_used, messages)
500490 }
501491 Storage => {
502492 // do not use a special title needed for "Storage":
@@ -538,7 +528,8 @@ impl Context {
538528 self . schedule_quota_update ( ) . await ?;
539529 }
540530 } else {
541- ret += & format ! ( "<li>{}</li>" , stock_str:: not_connected( self ) . await ) ;
531+ let not_connected = stock_str:: not_connected ( self ) . await ;
532+ ret += & format ! ( "<li>{}</li>" , not_connected) ;
542533 self . schedule_quota_update ( ) . await ?;
543534 }
544535 ret += "</ul>" ;
0 commit comments