diff --git a/crates/ruff_linter/src/rules/pydoclint/rules/check_docstring.rs b/crates/ruff_linter/src/rules/pydoclint/rules/check_docstring.rs index 81d300fd70838..55b24bfc2aee3 100644 --- a/crates/ruff_linter/src/rules/pydoclint/rules/check_docstring.rs +++ b/crates/ruff_linter/src/rules/pydoclint/rules/check_docstring.rs @@ -151,7 +151,7 @@ impl<'a> DocstringEntries<'a> { } // Parses docstring sections of supported styles. -fn parse_entries<'a>(content: &'a str, style: SectionStyle) -> Vec> { +fn parse_entries(content: &str, style: SectionStyle) -> Vec { match style { SectionStyle::Google => parse_entries_google(content), SectionStyle::Numpy => parse_entries_numpy(content), @@ -306,12 +306,7 @@ pub(crate) fn check_docstring( { let diagnostic = Diagnostic::new( DocstringMissingException { - id: body_raise - .qualified_name - .segments() - .last() - .unwrap() - .to_string(), + id: (*body_raise.qualified_name.segments().last().unwrap()).to_string(), }, body_raise.range, );