#[cfg(feature = "std")]
include!("with_std.rs");
#[cfg(not(feature = "std"))]
include!("without_std.rs");
#[derive(Default)]
pub struct Writer(vec::Vec<u8>);
impl fmt::Write for Writer {
fn write_str(&mut self, s: &str) -> fmt::Result {
self.0.extend(s.as_bytes());
Ok(())
}
}
impl Writer {
pub fn inner(&self) -> &vec::Vec<u8> {
&self.0
}
pub fn into_inner(self) -> vec::Vec<u8> {
self.0
}
}
pub mod prelude {
pub use super::{
borrow::ToOwned,
boxed::Box,
clone::Clone,
cmp::{Eq, PartialEq, Reverse},
iter::IntoIterator,
vec::Vec,
};
#[cfg(not(feature = "std"))]
pub use alloc::vec;
}