use crate::io::{Result, Write};
#[non_exhaustive]
#[derive(Clone, Copy, Debug, Default)]
pub struct Sink;
#[inline(always)]
#[must_use]
pub const fn sink() -> Sink {
Sink
}
impl Write for Sink {
#[inline]
fn write(&mut self, buf: &[u8]) -> Result<usize> {
Ok(buf.len())
}
#[inline(always)]
fn write_all(&mut self, _buf: &[u8]) -> Result<()> {
Ok(())
}
#[inline(always)]
fn flush(&mut self) -> Result<()> {
Ok(())
}
}
impl Write for &Sink {
#[inline]
fn write(&mut self, buf: &[u8]) -> Result<usize> {
Ok(buf.len())
}
#[inline(always)]
fn write_all(&mut self, _buf: &[u8]) -> Result<()> {
Ok(())
}
#[inline(always)]
fn flush(&mut self) -> Result<()> {
Ok(())
}
}