miniextendr_lint/
lint_code.rs1use std::fmt;
6
7#[derive(#[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
for LintCode {
}
#[automatically_derived]impl ::core::clone::Clone for LintCode {
#[inline]
fn clone(&self) -> Self { *self }
}Clone, #[automatically_derived]impl ::core::marker::Copy for LintCode { }Copy, #[automatically_derived]impl ::core::fmt::Debug for LintCode {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_c_like_enum_write_str(f,
"MXL008 MXL106 MXL110 MXL111 MXL120 MXL121 MXL203 MXL204 MXL300 MXL301 MXL302 MXL304 MXL305",
match self {
LintCode::MXL008 => 0usize,
LintCode::MXL106 => 7usize,
LintCode::MXL110 => 14usize,
LintCode::MXL111 => 21usize,
LintCode::MXL120 => 28usize,
LintCode::MXL121 => 35usize,
LintCode::MXL203 => 42usize,
LintCode::MXL204 => 49usize,
LintCode::MXL300 => 56usize,
LintCode::MXL301 => 63usize,
LintCode::MXL302 => 70usize,
LintCode::MXL304 => 77usize,
LintCode::MXL305 => 84usize,
})
}
}Debug, #[automatically_derived]impl ::core::marker::StructuralPartialEq for LintCode
{
}
#[automatically_derived]impl ::core::cmp::PartialEq for LintCode {
#[inline]
fn eq(&self, other: &Self) -> bool {
::core::intrinsics::discriminant_value(self) ==
::core::intrinsics::discriminant_value(other)
}
}PartialEq, #[automatically_derived]impl ::core::cmp::Eq for LintCode { }Eq, #[automatically_derived]impl ::core::hash::Hash for LintCode {
#[inline]
fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
::core::hash::Hash::hash(&::core::intrinsics::discriminant_value(self),
state)
}
}Hash, #[automatically_derived]impl ::core::cmp::PartialOrd for LintCode {
#[inline]
fn partial_cmp(&self, other: &Self)
-> ::core::option::Option<::core::cmp::Ordering> {
::core::option::Option::Some(::core::cmp::Ord::cmp(self, other))
}
}PartialOrd, #[automatically_derived]impl ::core::cmp::Ord for LintCode {
#[inline]
fn cmp(&self, other: &Self) -> ::core::cmp::Ordering {
::core::cmp::Ord::cmp(&::core::intrinsics::discriminant_value(self),
&::core::intrinsics::discriminant_value(other))
}
}Ord)]
11pub enum LintCode {
12 MXL008,
15 MXL106,
20 MXL110,
22 MXL111,
24 MXL120,
29 MXL121,
32 MXL203,
37 MXL204,
40 MXL300,
45 MXL301,
47 MXL302,
49 MXL304,
51 MXL305,
54 }
56
57impl fmt::Display for LintCode {
58 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
59 fmt::Debug::fmt(self, f)
61 }
62}
63
64impl LintCode {
65 pub fn default_severity(self) -> super::diagnostic::Severity {
67 use super::diagnostic::Severity;
68 match self {
69 Self::MXL008 => Severity::Error,
71
72 Self::MXL110 => Severity::Error,
74
75 Self::MXL120 => Severity::Error,
78
79 Self::MXL106
81 | Self::MXL111
82 | Self::MXL121
83 | Self::MXL203
84 | Self::MXL204
85 | Self::MXL300
86 | Self::MXL301
87 | Self::MXL302
88 | Self::MXL304
89 | Self::MXL305 => Severity::Warning,
90 }
91 }
92}