mirror of
https://github.com/teloxide/teloxide.git
synced 2025-03-20 13:59:00 +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 = ();
|
type Error = ();
|
||||||
|
|
||||||
fn try_from(value: bool) -> Result<Self, Self::Error> {
|
fn try_from(value: bool) -> Result<Self, Self::Error> {
|
||||||
|
#[allow(clippy::match_bool)]
|
||||||
match value {
|
match value {
|
||||||
true => Ok(True),
|
true => Ok(True),
|
||||||
false => Err(()),
|
false => Err(()),
|
||||||
|
@ -37,6 +38,7 @@ impl<'de> Visitor<'de> for TrueVisitor {
|
||||||
where
|
where
|
||||||
E: de::Error,
|
E: de::Error,
|
||||||
{
|
{
|
||||||
|
#[allow(clippy::match_bool)]
|
||||||
match value {
|
match value {
|
||||||
true => Ok(True),
|
true => Ok(True),
|
||||||
false => Err(E::custom("expected `true`, found `false`")),
|
false => Err(E::custom("expected `true`, found `false`")),
|
||||||
|
|
Loading…
Add table
Reference in a new issue