Skip to contentSlop Block

require-blank-line-between-methods

Warning

Leave a blank line after each multi-line member of an impl, trait, mod or class body.

impl User {Separate the methods in this block with blank lines	pub fn new() -> Self {		return Self;	}	fn name(&self) -> &str {		return &self.name;	}}
mod tests {Separate the methods in this block with blank lines	#[test]	fn signs() {		assert!(true);	}	#[test]	fn verifies() {}}
// ast-grep-ignore: require-blank-line-between-methods-rust

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.