more impls

This commit is contained in:
nora 2022-09-24 22:20:53 +02:00
parent 8862186a1f
commit 98025d204f
4 changed files with 72 additions and 49 deletions

View file

@ -33,28 +33,6 @@ pub trait Write {
}
}
impl Write for String {
fn write_str(&mut self, str: &str) -> Result {
self.push_str(str);
Ok(())
}
fn write_char(&mut self, char: char) -> Result {
self.push(char);
Ok(())
}
}
impl<W: Write> Write for &mut W {
fn write_str(&mut self, str: &str) -> Result {
<W as Write>::write_str(self, str)
}
fn write_char(&mut self, char: char) -> Result {
<W as Write>::write_char(self, char)
}
}
pub mod helpers {
use crate::{Arguments, Formatter, Result, Write};