1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use crate::{TextStr, TextSubstr};
use std::io;
use utf8_io::WriteStr;
pub trait WriteText: WriteStr {
#[inline]
fn write_text(&mut self, buf: &TextStr) -> io::Result<()> {
self.write_text_substr(buf.as_ref())
}
#[inline]
fn write_text_substr(&mut self, buf: &TextSubstr) -> io::Result<()> {
default_write_text_substr(self, buf)
}
}
#[inline]
pub fn default_write_text_substr<Inner: WriteStr + ?Sized>(
inner: &mut Inner,
buf: &TextSubstr,
) -> io::Result<()> {
inner.write_str(buf.as_ref())
}