Closed
Description
#[derive(Debug)]
pub struct MyEr;
#[mockall::automock]
pub trait MyTrait {
/// # Errors
///
/// some stuff
fn get<'a>(
&'a mut self,
data: i32,
) -> Result<&'a str, MyEr>;
}
this code after cargo check produces
warning: lifetime parameter `'a` only used once
--> src/main.rs:13:12
|
13 | fn get<'a>(
| ^^
| |
| this lifetime...
| ...is used only here
|
= note: requested on the command line with `-W single-use-lifetimes`
help: elide the single-use lifetime
|
13 - fn get<'a>(
13 + fn get<'_>(
|
there is an easy way out by applying #[allow]
on this method, but in my project allow is forbidden in favor of except (clippy::allow_attributes)
Metadata
Metadata
Assignees
Labels
No labels