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::write_str(f,
match self {
LintCode::MXL008 => "MXL008",
LintCode::MXL106 => "MXL106",
LintCode::MXL110 => "MXL110",
LintCode::MXL111 => "MXL111",
LintCode::MXL120 => "MXL120",
LintCode::MXL121 => "MXL121",
LintCode::MXL203 => "MXL203",
LintCode::MXL204 => "MXL204",
LintCode::MXL300 => "MXL300",
LintCode::MXL301 => "MXL301",
LintCode::MXL302 => "MXL302",
LintCode::MXL304 => "MXL304",
LintCode::MXL305 => "MXL305",
})
}
}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}