mirror of
https://github.com/Noratrieb/mono-fmt.git
synced 2026-01-16 16:25:07 +01:00
more impls
This commit is contained in:
parent
8862186a1f
commit
98025d204f
4 changed files with 72 additions and 49 deletions
22
src/lib.rs
22
src/lib.rs
|
|
@ -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};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue