Skip to contentSlop Block

require-impl-after-trait

Warning

When a file declares and implements a trait, the first impl comes right after the trait.

pub trait ConnectionExtension<D> {Place the first impl of $NAME right after the trait	fn transaction(&self);}pub struct Other;impl<D> ConnectionExtension<D> for Pool<D> {	fn transaction(&self) {}}
// ast-grep-ignore: require-impl-after-trait-rust

How to fix

When a file declares and implements a trait, put the first impl before any other item that follows the declaration.