use super::*;
pub struct Surrounded<'a, T>(&'a str, T, &'a str);
pub fn surround<'a, T>(prefix: &'a str, value: T, suffix: &'a str) -> Surrounded<'a, T> {
Surrounded(prefix, value, suffix)
}
impl<T: Debug> Debug for Surrounded<'_, T> {
fn fmt(&self, f: &mut Formatter) -> Result {
write!(f, "{}", self.0)?;
self.1.fmt(f)?;
write!(f, "{}", self.2)
}
}
impl<T: Display> Display for Surrounded<'_, T> {
fn fmt(&self, f: &mut Formatter) -> Result {
write!(f, "{}", self.0)?;
self.1.fmt(f)?;
write!(f, "{}", self.2)
}
}