mirror of
https://github.com/teloxide/teloxide.git
synced 2025-03-13 19:27:52 +01:00
fix build on the latest nightly
This commit is contained in:
parent
c2d9001051
commit
7fea75f2d7
2 changed files with 8 additions and 7 deletions
|
@ -1,4 +1,6 @@
|
|||
use std::{convert::Infallible, future::Future, pin::Pin};
|
||||
use std::{future::Future, pin::Pin};
|
||||
#[cfg(not(feature = "never-type"))]
|
||||
use std::convert::Infallible;
|
||||
|
||||
use async_trait::async_trait;
|
||||
|
||||
|
@ -82,23 +84,24 @@ where
|
|||
pub struct IgnoreSafe;
|
||||
|
||||
#[cfg(feature = "never-type")]
|
||||
#[allow(unreachable_code)]
|
||||
#[async_trait]
|
||||
impl ErrorPolicy<!> for IgnoreSafe {
|
||||
async fn handle_error(&self, never: !)
|
||||
async fn handle_error(&self, _: !)
|
||||
where
|
||||
!: 'async_trait,
|
||||
{
|
||||
never
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "never-type"))]
|
||||
#[allow(unreachable_code)]
|
||||
#[async_trait]
|
||||
impl ErrorPolicy<Infallible> for IgnoreSafe {
|
||||
async fn handle_error(&self, inf: Infallible)
|
||||
async fn handle_error(&self, _: Infallible)
|
||||
where
|
||||
Infallible: 'async_trait,
|
||||
{
|
||||
match inf {}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#![cfg_attr(feature = "never-type", feature(never_type))]
|
||||
|
||||
#[macro_use]
|
||||
extern crate derive_more;
|
||||
#[macro_use]
|
||||
|
|
Loading…
Add table
Reference in a new issue