1pub mod default_annotation;
8mod known_modifiers;
9
10use crate::lints::Context;
11use crate::LintSettings;
12
13pub use self::default_annotation::SetDefaultAnnotation;
14pub use self::known_modifiers::DefaultModifier;
15
16use snafu::Snafu;
17
18use std::fmt::Debug;
19
20#[derive(Debug, Snafu)]
21#[non_exhaustive]
22pub enum Error {
23 Custom {
24 source: Box<dyn std::error::Error + 'static>,
25 },
26}
27
28impl Error {
29 pub fn custom<E>(source: E) -> Self
30 where
31 E: 'static + std::error::Error,
32 {
33 Self::Custom {
34 source: Box::new(source) as Box<dyn std::error::Error>,
35 }
36 }
37}
38
39pub trait Modifier: Debug {
40 fn modify(&self, context: &Context, settings: &mut LintSettings) -> Result<(), Error>;
41}