rune_alloc/fmt/impls.rs
1use crate::alloc::Allocator;
2use crate::error::Error;
3use crate::vec::Vec;
4
5use super::TryWrite;
6
7/// [`TryWrite`] is implemented for `Vec<u8>` by appending to the vector. The
8/// vector will grow as needed.
9impl<A> TryWrite for Vec<u8, A>
10where
11 A: Allocator,
12{
13 #[inline]
14 fn try_write_str(&mut self, s: &str) -> Result<(), Error> {
15 self.try_extend_from_slice(s.as_bytes())
16 }
17}