Added default trait impls to `Infallible`.

Fortune for termprogress's current commit: Future small blessing − 末小吉
small-refactor
Avril 3 weeks ago
parent c2d875cc40
commit 0ef800e077
Signed by: flanchan
GPG Key ID: 284488987C31F630

@ -138,6 +138,57 @@ where T: Spinner + ?Sized
}
}
impl Display for std::convert::Infallible
{
#[inline] fn refresh(&self)
{
}
#[inline] fn blank(&self)
{
}
#[inline] fn println(&self, _: &str)
{
}
#[inline] fn eprintln(&self, _: &str)
{
}
#[inline] fn get_title(&self) -> &str
{
match *self {}
}
#[inline] fn set_title(&mut self, _: &str)
{
}
#[inline] fn update_dimensions(&mut self, _: usize)
{
}
}
impl ProgressBar for std::convert::Infallible
{
#[inline] fn set_progress(&mut self, _: f64)
{
}
#[inline] fn get_progress(&self) -> f64
{
match *self {}
}
}
impl Spinner for std::convert::Infallible
{
#[inline] fn bump(&mut self){}
}
#[cfg(nightly)] mod never
{
use super::*;

@ -31,6 +31,7 @@ macro_rules! flush {
/// The default place to write bars to if an output is not user-specified.
pub(crate) type DefaultOutputDevice = std::io::Stdout;
/// A function that creates the default output device object for constructing a progress bar.
///
/// This must return multiple handles, since multiple bars can exist throughout the program at overlapping lifetimes.

Loading…
Cancel
Save