From 48a7bf5c0a3d26027a18ffd1d098735df23e4202 Mon Sep 17 00:00:00 2001 From: Philipp Hofer Date: Thu, 13 Mar 2025 15:56:09 +0100 Subject: [PATCH] cargo clippy --- src/law/mod.rs | 12 ++++++------ src/paragraph/mod.rs | 4 ++-- src/paragraph/parser/mod.rs | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/law/mod.rs b/src/law/mod.rs index c615c00..ef25795 100644 --- a/src/law/mod.rs +++ b/src/law/mod.rs @@ -285,7 +285,7 @@ impl Builder { /// # Parameters /// /// - `name`: A string slice representing the name of the new heading. The name is trimmed of - /// any leading or trailing whitespace before processing. + /// any leading or trailing whitespace before processing. /// /// # Behavior /// @@ -383,15 +383,15 @@ impl Builder { /// # Parameters /// /// - `desc`: A string slice representing the new description to be assigned to the last - /// classifier. The description is trimmed of any leading or trailing whitespace before being - /// set. + /// classifier. The description is trimmed of any leading or trailing whitespace before being + /// set. /// /// # Behavior /// /// - The method trims the input description. - It then attempts to update the description of - /// the last classifier. If no classifier has been added before this method is called, the - /// function will panic, indicating that setting a description requires a preceding classifier - /// to be in place. + /// the last classifier. If no classifier has been added before this method is called, the + /// function will panic, indicating that setting a description requires a preceding classifier + /// to be in place. /// /// # Panics /// diff --git a/src/paragraph/mod.rs b/src/paragraph/mod.rs index 5e3e28b..13cee14 100644 --- a/src/paragraph/mod.rs +++ b/src/paragraph/mod.rs @@ -82,8 +82,8 @@ impl Parser { /// # Parameters /// /// - `url`: The URL from which to fetch the law text. - `builder`: A mutable reference to a - /// `law::Builder` instance, which is used to construct the law structure based on the parsed - /// content. + /// `law::Builder` instance, which is used to construct the law structure based on the parsed + /// content. /// /// # Returns /// diff --git a/src/paragraph/parser/mod.rs b/src/paragraph/parser/mod.rs index c79a777..205c28e 100644 --- a/src/paragraph/parser/mod.rs +++ b/src/paragraph/parser/mod.rs @@ -42,7 +42,7 @@ impl<'a> From<&'a Node<'a, 'a>> for Expect<'a> { } } -impl<'a> Expect<'a> { +impl Expect<'_> { fn tag(self, value: &str) -> Self { assert!( self.node.tag_name().name() == value, @@ -303,7 +303,7 @@ impl Td { let mut c = n.children(); - let Some(next) = c.next() else { return None }; + let next = c.next()?; let absatz = Absatz::parse(next);