mirror of
https://github.com/tower-rs/tower.git
synced 2025-09-30 14:31:41 +00:00
chore: replace Never
with Infallible
(#612)
Co-authored-by: Eliza Weisman <eliza@buoyant.io>
This commit is contained in:
parent
0e907963c3
commit
4bcfaeb33e
@ -1,12 +0,0 @@
|
||||
use std::{error::Error, fmt};
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum Never {}
|
||||
|
||||
impl fmt::Display for Never {
|
||||
fn fmt(&self, _: &mut fmt::Formatter) -> fmt::Result {
|
||||
match *self {}
|
||||
}
|
||||
}
|
||||
|
||||
impl Error for Never {}
|
@ -1,6 +1,7 @@
|
||||
use super::{error::Never, Change};
|
||||
use super::Change;
|
||||
use futures_core::Stream;
|
||||
use pin_project_lite::pin_project;
|
||||
use std::convert::Infallible;
|
||||
use std::iter::{Enumerate, IntoIterator};
|
||||
use std::{
|
||||
pin::Pin,
|
||||
@ -41,7 +42,7 @@ impl<T, U> Stream for ServiceList<T>
|
||||
where
|
||||
T: IntoIterator<Item = U>,
|
||||
{
|
||||
type Item = Result<Change<usize, U>, Never>;
|
||||
type Item = Result<Change<usize, U>, Infallible>;
|
||||
|
||||
fn poll_next(self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll<Option<Self::Item>> {
|
||||
match self.project().inner.next() {
|
||||
|
@ -33,7 +33,6 @@
|
||||
//!
|
||||
//! [`TryStream`]: https://docs.rs/futures/latest/futures/stream/trait.TryStream.html
|
||||
|
||||
mod error;
|
||||
mod list;
|
||||
|
||||
pub use self::list::ServiceList;
|
||||
|
@ -1,12 +0,0 @@
|
||||
use std::fmt;
|
||||
#[derive(Debug)]
|
||||
/// An error that can never occur.
|
||||
pub enum Never {}
|
||||
|
||||
impl fmt::Display for Never {
|
||||
fn fmt(&self, _: &mut fmt::Formatter) -> fmt::Result {
|
||||
match *self {}
|
||||
}
|
||||
}
|
||||
|
||||
impl std::error::Error for Never {}
|
@ -1,13 +0,0 @@
|
||||
use std::fmt;
|
||||
|
||||
#[derive(Debug)]
|
||||
/// An error that can never occur.
|
||||
pub enum Never {}
|
||||
|
||||
impl fmt::Display for Never {
|
||||
fn fmt(&self, _: &mut fmt::Formatter) -> fmt::Result {
|
||||
match *self {}
|
||||
}
|
||||
}
|
||||
|
||||
impl std::error::Error for Never {}
|
Loading…
x
Reference in New Issue
Block a user