use std::{
error::Error,
fmt,
};
use crate::RedactionPolicy;
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct InstallGlobalPolicyError(pub(crate) RedactionPolicy);
impl InstallGlobalPolicyError {
#[must_use = "use the rejected policy or drop it explicitly"]
pub fn into_policy(self) -> RedactionPolicy {
self.0
}
}
impl fmt::Display for InstallGlobalPolicyError {
fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
formatter.write_str("the global redaction policy is already installed")
}
}
impl Error for InstallGlobalPolicyError {}