#[derive(Clone, Copy, Debug, PartialEq, Eq)] pub struct RfcRef(pub &'static str); #[derive(Clone, Debug, PartialEq, Eq)] pub struct Warning { pub message: String, pub rfc_refs: Vec, pub context: Option, } impl Warning { pub fn new(message: impl Into) -> Self { Self { message: message.into(), rfc_refs: Vec::new(), context: None, } } pub fn with_rfc_refs(mut self, refs: &[RfcRef]) -> Self { self.rfc_refs.extend_from_slice(refs); self } pub fn with_context(mut self, context: impl Into) -> Self { self.context = Some(context.into()); self } }