@@ -31,7 +31,7 @@ pub struct Identifier {
31
31
}
32
32
33
33
impl Identifier {
34
- /// Construct a new [`Identifier`]. The `high` parameter is masked so to pack
34
+ /// Construct a new [`Identifier`]. The `high` parameter is masked so we can pack
35
35
/// the high value and bit flags into the same field.
36
36
#[ inline( always) ]
37
37
pub const fn new (
@@ -95,7 +95,7 @@ impl Identifier {
95
95
IdentifierMask :: extract_kind_from_high ( self . high . get ( ) )
96
96
}
97
97
98
- /// Returns with the [`Identifier`] is in a `hidden ` state.
98
+ /// Returns with the [`Identifier`] is in a `togglable ` state.
99
99
#[ inline( always) ]
100
100
pub const fn is_togglable ( self ) -> bool {
101
101
self . flags ( ) . contains ( IdentifierFlagBits :: IS_TOGGLABLE )
@@ -114,16 +114,16 @@ impl Identifier {
114
114
IdentifierMask :: extract_flags_from_high ( self . high . get ( ) )
115
115
}
116
116
117
- /// Returns a `hidden ` [`Identifier`].
117
+ /// Returns a `togglable ` [`Identifier`].
118
118
#[ inline( always) ]
119
119
#[ must_use]
120
- pub const fn set_hidden ( self , state : bool ) -> Identifier {
120
+ pub const fn set_togglable ( self , state : bool ) -> Identifier {
121
121
Self {
122
122
low : self . low ,
123
123
// SAFETY: the high component will always be non-zero due to either the
124
124
// placeholder flag or the value component not being modified and either
125
125
// one guaranteed to be one due to Identifier being initialised with the
126
- // correct invariants checked. As such, modifying the hidden bit will
126
+ // correct invariants checked. As such, modifying the togglable bit will
127
127
// never result in a zero value.
128
128
high : unsafe {
129
129
NonZeroU32 :: new_unchecked ( IdentifierMask :: set_togglable_flag_in_high (
@@ -275,7 +275,7 @@ mod tests {
275
275
276
276
assert ! ( id. is_togglable( ) ) ;
277
277
278
- let id = id. set_hidden ( false ) ;
278
+ let id = id. set_togglable ( false ) ;
279
279
280
280
assert_eq ! ( id. to_bits( ) , 0x3FFF_FFFF_0000_000C ) ;
281
281
assert ! ( !id. is_togglable( ) ) ;
0 commit comments