@@ -390,7 +390,8 @@ impl Context {
390
390
// =============================================================================================
391
391
392
392
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) ;
394
395
for ( folder, state) in & folders_states {
395
396
let mut folder_added = false ;
396
397
@@ -432,10 +433,8 @@ impl Context {
432
433
// Your last message was sent successfully
433
434
// =============================================================================================
434
435
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) ;
439
438
let detailed = smtp. get_detailed ( ) . await ;
440
439
ret += & * detailed. to_icon ( ) ;
441
440
ret += " " ;
@@ -450,10 +449,8 @@ impl Context {
450
449
// =============================================================================================
451
450
452
451
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) ;
457
454
let quota = self . quota . read ( ) . await ;
458
455
if let Some ( quota) = & * quota {
459
456
match & quota. recent {
@@ -473,30 +470,23 @@ impl Context {
473
470
info ! ( self , "connectivity: root name hidden: \" {}\" " , root_name) ;
474
471
}
475
472
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 ;
476
480
ret += & match & resource. name {
477
481
Atom ( resource_name) => {
478
482
format ! (
479
483
"<b>{}:</b> {}" ,
480
484
& * 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
487
486
)
488
487
}
489
488
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)
500
490
}
501
491
Storage => {
502
492
// do not use a special title needed for "Storage":
@@ -538,7 +528,8 @@ impl Context {
538
528
self . schedule_quota_update ( ) . await ?;
539
529
}
540
530
} 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) ;
542
533
self . schedule_quota_update ( ) . await ?;
543
534
}
544
535
ret += "</ul>" ;
0 commit comments