mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-23 06:51:01 +01:00
Allow matching on bool
for in src/types/unit_true.rs
This commit is contained in:
parent
101630a3a1
commit
c466402594
1 changed files with 2 additions and 0 deletions
|
@ -8,6 +8,7 @@ impl std::convert::TryFrom<bool> for True {
|
|||
type Error = ();
|
||||
|
||||
fn try_from(value: bool) -> Result<Self, Self::Error> {
|
||||
#[allow(clippy::match_bool)]
|
||||
match value {
|
||||
true => Ok(True),
|
||||
false => Err(()),
|
||||
|
@ -37,6 +38,7 @@ impl<'de> Visitor<'de> for TrueVisitor {
|
|||
where
|
||||
E: de::Error,
|
||||
{
|
||||
#[allow(clippy::match_bool)]
|
||||
match value {
|
||||
true => Ok(True),
|
||||
false => Err(E::custom("expected `true`, found `false`")),
|
||||
|
|
Loading…
Reference in a new issue