use std::fmt::{
self,
Display,
Formatter,
};
use crate::LogSafeText;
#[must_use = "render the redacted pair instead of the original environment value"]
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct RedactedEnvPair {
name: LogSafeText<'static>,
value: LogSafeText<'static>,
}
impl RedactedEnvPair {
#[inline(always)]
pub(super) const fn new(
name: LogSafeText<'static>,
value: LogSafeText<'static>,
) -> Self {
Self { name, value }
}
}
impl Display for RedactedEnvPair {
#[inline]
fn fmt(&self, formatter: &mut Formatter<'_>) -> fmt::Result {
write!(formatter, "{}={}", self.name, self.value)
}
}