1 #![warn(clippy::single_char_lifetime_names)]
3 // Lifetimes should only be linted when they're introduced
4 struct DiagnosticCtx<'a, 'b>
12 // Only the lifetimes on the `impl`'s generics should be linted
13 impl<'a, 'b> DiagnosticCtx<'a, 'b> {
14 fn new(source: &'a str, unit: &'b ()) -> DiagnosticCtx<'a, 'b> {
22 // No lifetimes should be linted here
23 impl<'src, 'unit> DiagnosticCtx<'src, 'unit> {
24 fn new_pass(source: &'src str, unit: &'unit ()) -> DiagnosticCtx<'src, 'unit> {
32 // Only 'a should be linted here
33 fn split_once<'a>(base: &'a str, other: &'_ str) -> (&'a str, Option<&'a str>) {
34 base.split_once(other)
35 .map(|(left, right)| (left, Some(right)))
36 .unwrap_or((base, None))
42 DiagnosticCtx::new(src, &unit);