use super::Sensitivity;
#[derive(Clone, Copy)]
pub(crate) enum ResolvedField {
Sensitive {
sensitivity: Sensitivity,
},
PassThrough,
}
impl ResolvedField {
#[must_use]
#[cfg(feature = "http")]
pub(crate) fn stronger(self, context: Self) -> Self {
match (self, context) {
(Self::Sensitive { sensitivity: base }, Self::Sensitive { sensitivity: context }) => Self::Sensitive {
sensitivity: base.max(context),
},
(Self::Sensitive { sensitivity }, Self::PassThrough)
| (Self::PassThrough, Self::Sensitive { sensitivity }) => Self::Sensitive { sensitivity },
(Self::PassThrough, Self::PassThrough) => Self::PassThrough,
}
}
}