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