Fix clippy.
All checks were successful
format Build format has succeeded
clippy Build clippy has succeeded
rust-test Build rust-test has succeeded

This commit is contained in:
Tom Alexander
2025-02-22 19:42:24 -05:00
parent 7d73a3c948
commit 8d85d5ef79
7 changed files with 19 additions and 16 deletions

View File

@@ -31,6 +31,7 @@ intermediate!(
);
impl IParagraph {
#[allow(clippy::needless_lifetimes)]
pub(crate) async fn artificial<'orig, 'parse>(
_intermediate_context: crate::intermediate::IntermediateContext<'orig, 'parse>,
children: Vec<IObject>,
@@ -50,19 +51,19 @@ impl IParagraph {
.children
.iter()
.filter(|c| match c {
IObject::RegularLink(iregular_link) => match &iregular_link.target {
super::LinkTarget::Image { src: _, alt: _ } => true,
_ => false,
},
IObject::RegularLink(iregular_link) => matches!(
&iregular_link.target,
super::LinkTarget::Image { src: _, alt: _ }
),
_ => false,
})
.count();
num_images == 1
&& self.children.iter().all(|c| match c {
IObject::RegularLink(iregular_link) => match &iregular_link.target {
super::LinkTarget::Image { src: _, alt: _ } => true,
_ => false,
},
IObject::RegularLink(iregular_link) => matches!(
&iregular_link.target,
super::LinkTarget::Image { src: _, alt: _ }
),
IObject::PlainText(iplain_text) => {
iplain_text.source.chars().all(|c| c.is_ascii_whitespace())
}