string.rs
//! Implementations of `Localize` for various string types
use std::borrow::Cow;
use crate::{Context, Localize};
macro_rules! impl_string {
($string_type:ty) => {
impl Localize for $string_type {
fn localize(&self, _context: &Context, buffer: &mut String) {
buffer.push_str(self.as_ref());
}
}
};
}
impl_string!(String);
impl_string!(&str);
impl_string!(Box<str>);
impl_string!(Cow<'_, str>);