prefer-extension-trait
HintConsider a trait method when a free function takes &PgPool, &Context or a similar type first.
async fn process_transcript(connection: &PgPool, body: &Body) -> Result<()> { return Ok(());}fn get_user<'c>(context: &Context<'c>) -> Result<&'c User> { return context.get::<User>();}impl PgPoolExtension for PgPool { fn create(connection: &PgPool) -> Result<Self> { return Ok(connection.clone()); }}fn parse_user_identity(identity: &str) -> Option<UserID> { return None;}How to fix
Move it to an extension trait on that type, or to a repository trait when it runs queries.