minor: it's Parameter, not Argument
This commit is contained in:
parent
341f8bb200
commit
159922de93
@ -349,11 +349,11 @@ impl fmt::Display for CaseType {
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum IdentType {
|
||||
Argument,
|
||||
Constant,
|
||||
Enum,
|
||||
Field,
|
||||
Function,
|
||||
Parameter,
|
||||
StaticVariable,
|
||||
Structure,
|
||||
Variable,
|
||||
@ -363,11 +363,11 @@ pub enum IdentType {
|
||||
impl fmt::Display for IdentType {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
let repr = match self {
|
||||
IdentType::Argument => "Argument",
|
||||
IdentType::Constant => "Constant",
|
||||
IdentType::Enum => "Enum",
|
||||
IdentType::Field => "Field",
|
||||
IdentType::Function => "Function",
|
||||
IdentType::Parameter => "Parameter",
|
||||
IdentType::StaticVariable => "Static variable",
|
||||
IdentType::Structure => "Structure",
|
||||
IdentType::Variable => "Variable",
|
||||
|
@ -256,7 +256,7 @@ impl<'a, 'b> DeclValidator<'a, 'b> {
|
||||
}
|
||||
|
||||
let ident_type =
|
||||
if is_param { IdentType::Argument } else { IdentType::Variable };
|
||||
if is_param { IdentType::Parameter } else { IdentType::Variable };
|
||||
|
||||
let diagnostic = IncorrectCase {
|
||||
file: source_ptr.file_id,
|
||||
@ -643,10 +643,10 @@ fn NonSnakeCaseName() {}
|
||||
check_diagnostics(
|
||||
r#"
|
||||
fn foo(SomeParam: u8) {}
|
||||
// ^^^^^^^^^ Argument `SomeParam` should have snake_case name, e.g. `some_param`
|
||||
// ^^^^^^^^^ Parameter `SomeParam` should have snake_case name, e.g. `some_param`
|
||||
|
||||
fn foo2(ok_param: &str, CAPS_PARAM: u8) {}
|
||||
// ^^^^^^^^^^ Argument `CAPS_PARAM` should have snake_case name, e.g. `caps_param`
|
||||
// ^^^^^^^^^^ Parameter `CAPS_PARAM` should have snake_case name, e.g. `caps_param`
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user