@@ -41,24 +41,24 @@ bitflags::bitflags! {
41
41
pub struct CharacterSet : u8 {
42
42
const Uppercase = 0b0001 ;
43
43
const Lowercase = 0b0010 ;
44
- const Numbers = 0b0100 ;
44
+ const Digits = 0b0100 ;
45
45
const Symbols = 0b1000 ;
46
46
47
47
const Letters = Self :: Uppercase . bits( ) | Self :: Lowercase . bits( ) ;
48
- const All = Self :: Letters . bits( ) | Self :: Numbers . bits( ) | Self :: Symbols . bits( ) ;
48
+ const All = Self :: Letters . bits( ) | Self :: Digits . bits( ) | Self :: Symbols . bits( ) ;
49
49
}
50
50
}
51
51
52
52
impl CharacterSet {
53
53
const LOWERCASE : & ' static str = "abcdefghijklmnopqrstuvwxyz" ;
54
54
const UPPERCASE : & ' static str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ;
55
- const NUMBERS : & ' static str = "0123456789" ;
55
+ const DIGITS : & ' static str = "0123456789" ;
56
56
const SYMBOLS : & ' static str = "!\" #$%&'()*+,-./:;<=>?@[\\ ]^_`{|}~" ;
57
57
58
58
/// Returns a string that contains all the characters that may be used to
59
59
/// generate a password.
60
60
pub const fn get_characters ( self ) -> & ' static str {
61
- match ( self . contains ( Self :: Lowercase ) , self . contains ( Self :: Uppercase ) , self . contains ( Self :: Numbers ) , self . contains ( Self :: Symbols ) ) {
61
+ match ( self . contains ( Self :: Lowercase ) , self . contains ( Self :: Uppercase ) , self . contains ( Self :: Digits ) , self . contains ( Self :: Symbols ) ) {
62
62
( true , true , true , true ) => "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!\" #$%&'()*+,-./:;<=>?@[\\ ]^_`{|}~" ,
63
63
( true , true , true , false ) => "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" ,
64
64
( true , true , false , true ) => "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!\" #$%&'()*+,-./:;<=>?@[\\ ]^_`{|}~" ,
@@ -75,7 +75,7 @@ impl CharacterSet {
75
75
( false , true , false , false ) => Self :: UPPERCASE ,
76
76
77
77
( false , false , true , true ) => "0123456789!\" #$%&'()*+,-./:;<=>?@[\\ ]^_`{|}~" ,
78
- ( false , false , true , false ) => Self :: NUMBERS ,
78
+ ( false , false , true , false ) => Self :: DIGITS ,
79
79
( false , false , false , true ) => Self :: SYMBOLS ,
80
80
81
81
_ => ""
@@ -99,8 +99,8 @@ impl CharacterSet {
99
99
sets[ sets_len] = Self :: UPPERCASE ;
100
100
sets_len += 1 ;
101
101
}
102
- if self . contains ( Self :: Numbers ) {
103
- sets[ sets_len] = Self :: NUMBERS ;
102
+ if self . contains ( Self :: Digits ) {
103
+ sets[ sets_len] = Self :: DIGITS ;
104
104
sets_len += 1 ;
105
105
}
106
106
if self . contains ( Self :: Symbols ) {
0 commit comments