tnipv_lint/modifiers/
known_modifiers.rs

1/*
2 * This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at https://mozilla.org/MPL/2.0/.
5 */
6
7use crate::lints::Context;
8use crate::LintSettings;
9
10use serde::{Deserialize, Serialize};
11
12use std::fmt::Debug;
13
14use super::{default_annotation, Modifier};
15
16#[derive(Debug, Clone, Serialize, Deserialize)]
17#[serde(tag = "kind", rename_all = "kebab-case")]
18#[non_exhaustive]
19pub enum DefaultModifier<S> {
20    SetDefaultAnnotation(default_annotation::SetDefaultAnnotation<S>),
21}
22
23impl<S> Modifier for DefaultModifier<S>
24where
25    S: Debug + AsRef<str>,
26{
27    fn modify(&self, context: &Context, settings: &mut LintSettings) -> Result<(), super::Error> {
28        match self {
29            Self::SetDefaultAnnotation(a) => a.modify(context, settings),
30        }
31    }
32}