rust: Apply suggested fixes from clippy

Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
This commit is contained in:
Steffen Eiden
2025-12-01 15:28:38 +01:00
parent 2a99007a6e
commit c403208332
11 changed files with 23 additions and 20 deletions

View File

@@ -41,11 +41,11 @@ pub fn docstring(attr: &str) -> Option<String> {
let mut doc = attr
.strip_prefix("doc = r\"")
.unwrap()
.strip_suffix("\"")
.strip_suffix('\"')
.unwrap()
.to_string();
if doc.starts_with(" ") {
doc = doc.strip_prefix(" ").unwrap().to_string();
if doc.starts_with(' ') {
doc = doc.strip_prefix(' ').unwrap().to_string();
}
Some(doc)
}