Fix code style issues

This commit is contained in:
Igor Aleksanov 2020-10-04 09:26:39 +03:00
parent 50a147dcdf
commit 9ea57cac0e
3 changed files with 7 additions and 4 deletions

View file

@ -21,7 +21,7 @@ pub fn validate_module_item(
owner: ModuleDefId,
sink: &mut DiagnosticSink<'_>,
) {
let _p = profile::span("validate_body");
let _p = profile::span("validate_module_item");
let mut validator = decl_check::DeclValidator::new(owner, sink);
validator.validate_item(db);
}

View file

@ -1,9 +1,14 @@
//! Provides validators for the item declarations.
//!
//! This includes the following items:
//!
//! - variable bindings (e.g. `let x = foo();`)
//! - struct fields (e.g. `struct Foo { field: u8 }`)
//! - enum fields (e.g. `enum Foo { Variant { field: u8 } }`)
//! - enum variants (e.g. `enum Foo { Variant { field: u8 } }`)
//! - function/method arguments (e.g. `fn foo(arg: u8)`)
//! - constants (e.g. `const FOO: u8 = 10;`)
//! - static items (e.g. `static FOO: u8 = 10;`)
//! - match arm bindings (e.g. `foo @ Some(_)`)
mod str_helpers;
@ -48,7 +53,6 @@ impl<'a, 'b> DeclValidator<'a, 'b> {
}
pub(super) fn validate_item(&mut self, db: &dyn HirDatabase) {
// let def = self.owner.into();
match self.owner {
ModuleDefId::FunctionId(func) => self.validate_func(db, func),
ModuleDefId::AdtId(adt) => self.validate_adt(db, adt),

View file

@ -135,7 +135,6 @@ fn diagnostic_with_fix<D: DiagnosticWithFix>(d: &D, sema: &Semantics<RootDatabas
fn warning_with_fix<D: DiagnosticWithFix>(d: &D, sema: &Semantics<RootDatabase>) -> Diagnostic {
Diagnostic {
// name: Some(d.name().into()),
range: sema.diagnostics_display_range(d).range,
message: d.message(),
severity: Severity::WeakWarning,