require-blank-line-between-methods
WarningWarningWarningWarningLeave a blank line after each multi-line member of an impl, trait, mod or class body.
impl User { pub fn new() -> Self { return Self; } fn name(&self) -> &str { return &self.name; }}mod tests { #[test] fn signs() { assert!(true); } #[test] fn verifies() {}}impl User { pub fn new() -> Self { if ready { prepare(); } return Self; } fn name(&self) -> &str { return &self.name; }}mod tests { use super::*; #[test] fn signs() {} #[test] fn verifies() {}}class Store { public load() { return this.value; } public save() {}}class Store { private value = 1; private other = 2; public load() { if (ready) { prepare(); } return this.value; } public save() {}}class Store { int load() { return value; } void save() {}}class Store { Store(this.value); final int value; int load() { return value; } void save() {}}class Store { int load() { return value; } void save() {}}class Store { int load() { return value; } void save() {}}How to fix
In impl, trait and mod blocks, leave a blank line between a multi-line member such as a method and the next member.
The report points at the block because the syntax tree has no blank lines. The check compares each member's indentation with the block's closing brace.
How to fix
In a class body, leave a blank line between a multi-line member such as a method and the next member.
The report points at the block because the syntax tree has no blank lines. The check compares each member's indentation with the block's closing brace.
How to fix
In a class body, leave a blank line between a multi-line member such as a method and the next member.
The report points at the block because the syntax tree has no blank lines. The check compares each member's indentation with the block's closing brace.
How to fix
In a class body, leave a blank line between a multi-line member such as a method and the next member.
The report points at the block because the syntax tree has no blank lines. The check compares each member's indentation with the block's closing brace.