@@ -156,7 +156,7 @@ pub struct CipherListView {
156
156
pub key : Option < EncString > ,
157
157
158
158
pub name : String ,
159
- pub sub_title : String ,
159
+ pub subtitle : String ,
160
160
161
161
pub r#type : CipherListViewType ,
162
162
@@ -353,18 +353,18 @@ impl Cipher {
353
353
/// Builds the subtitle for a card cipher
354
354
fn build_subtitle_card ( brand : Option < String > , number : Option < String > ) -> String {
355
355
// Attempt to pre-allocate the string with the expected max-size
356
- let mut sub_title =
356
+ let mut subtitle =
357
357
String :: with_capacity ( brand. as_ref ( ) . map ( |b| b. len ( ) ) . unwrap_or_default ( ) + 8 ) ;
358
358
359
359
if let Some ( brand) = brand {
360
- sub_title . push_str ( & brand) ;
360
+ subtitle . push_str ( & brand) ;
361
361
}
362
362
363
363
if let Some ( number) = number {
364
364
let number_len = number. len ( ) ;
365
365
if number_len > 4 {
366
- if !sub_title . is_empty ( ) {
367
- sub_title . push_str ( ", " ) ;
366
+ if !subtitle . is_empty ( ) {
367
+ subtitle . push_str ( ", " ) ;
368
368
}
369
369
370
370
// On AMEX cards we show 5 digits instead of 4
@@ -373,12 +373,12 @@ fn build_subtitle_card(brand: Option<String>, number: Option<String>) -> String
373
373
_ => 4 ,
374
374
} ;
375
375
376
- sub_title . push ( '*' ) ;
377
- sub_title . push_str ( & number[ ( number_len - digit_count) ..] ) ;
376
+ subtitle . push ( '*' ) ;
377
+ subtitle . push_str ( & number[ ( number_len - digit_count) ..] ) ;
378
378
}
379
379
}
380
380
381
- sub_title
381
+ subtitle
382
382
}
383
383
384
384
/// Builds the subtitle for a card cipher
@@ -390,20 +390,20 @@ fn build_subtitle_identity(first_name: Option<String>, last_name: Option<String>
390
390
( None , None ) => 0 ,
391
391
} ;
392
392
393
- let mut sub_title = String :: with_capacity ( len) ;
393
+ let mut subtitle = String :: with_capacity ( len) ;
394
394
395
395
if let Some ( first_name) = & first_name {
396
- sub_title . push_str ( first_name) ;
396
+ subtitle . push_str ( first_name) ;
397
397
}
398
398
399
399
if let Some ( last_name) = & last_name {
400
- if !sub_title . is_empty ( ) {
401
- sub_title . push ( ' ' ) ;
400
+ if !subtitle . is_empty ( ) {
401
+ subtitle . push ( ' ' ) ;
402
402
}
403
- sub_title . push_str ( last_name) ;
403
+ subtitle . push_str ( last_name) ;
404
404
}
405
405
406
- sub_title
406
+ subtitle
407
407
}
408
408
409
409
impl CipherView {
@@ -555,7 +555,7 @@ impl KeyDecryptable<SymmetricCryptoKey, CipherListView> for Cipher {
555
555
collection_ids : self . collection_ids . clone ( ) ,
556
556
key : self . key . clone ( ) ,
557
557
name : self . name . decrypt_with_key ( key) . ok ( ) . unwrap_or_default ( ) ,
558
- sub_title : self . get_decrypted_subtitle ( key) . ok ( ) . unwrap_or_default ( ) ,
558
+ subtitle : self . get_decrypted_subtitle ( key) . ok ( ) . unwrap_or_default ( ) ,
559
559
r#type : match self . r#type {
560
560
CipherType :: Login => {
561
561
let login = self
@@ -802,7 +802,7 @@ mod tests {
802
802
collection_ids: cipher. collection_ids,
803
803
key: cipher. key,
804
804
name: "My test login" . to_string( ) ,
805
- sub_title : "test_username" . to_string( ) ,
805
+ subtitle : "test_username" . to_string( ) ,
806
806
r#type: CipherListViewType :: Login {
807
807
has_fido2: true ,
808
808
totp: cipher. login. as_ref( ) . unwrap( ) . totp. clone( )
0 commit comments