Skip to content

Commit d38776a

Browse files
authored
fix: impl From<bool> for Toggled (#585)
1 parent 45b60d8 commit d38776a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

common/src/lib.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,16 @@ pub enum Toggled {
462462
Mixed,
463463
}
464464

465+
impl From<bool> for Toggled {
466+
#[inline]
467+
fn from(b: bool) -> Self {
468+
match b {
469+
false => Self::False,
470+
true => Self::True,
471+
}
472+
}
473+
}
474+
465475
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
466476
#[cfg_attr(feature = "enumn", derive(enumn::N))]
467477
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]

0 commit comments

Comments
 (0)