calm down clippy even more (#1997)

This commit is contained in:
Beiri22 2023-08-25 14:27:50 +02:00 committed by GitHub
parent 94df32a919
commit ea469c2df6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 22 additions and 26 deletions

View File

@ -172,7 +172,9 @@ impl<'a> Handler<'a> {
md::Event::Html(html) if html.starts_with("<contributors") => {
let from = html_attr(html, "from").unwrap();
let to = html_attr(html, "to").unwrap();
let Some(output) = contributors(self.resolver, from, to) else { return false };
let Some(output) = contributors(self.resolver, from, to) else {
return false;
};
*html = output.raw.into();
}

View File

@ -229,9 +229,7 @@ impl Layout for TableElem {
/// and after the extents, e.g. [10mm, 5mm] -> [0mm, 10mm, 15mm].
fn points(extents: impl IntoIterator<Item = Abs>) -> impl Iterator<Item = Abs> {
let mut offset = Abs::zero();
std::iter::once(Abs::zero())
.chain(extents.into_iter())
.map(move |extent| {
std::iter::once(Abs::zero()).chain(extents).map(move |extent| {
offset += extent;
offset
})

View File

@ -249,14 +249,12 @@ impl Layout for EquationElem {
// Find a math font.
let variant = variant(styles);
let world = vt.world;
let Some(font) = families(styles)
.find_map(|family| {
let Some(font) = families(styles).find_map(|family| {
let id = world.book().select(family.as_str(), variant)?;
let font = world.font(id)?;
let _ = font.ttf().tables().math?.constants?;
Some(font)
})
else {
}) else {
bail!(self.span(), "current font does not support math");
};

View File

@ -214,7 +214,8 @@ impl Show for OutlineElem {
self.span(),
elem.clone().into_inner(),
self.fill(styles),
)? else {
)?
else {
continue;
};

View File

@ -515,8 +515,7 @@ fn parse_theme(
vm: &mut Vm,
args: &mut Args,
) -> SourceResult<(Option<EcoString>, Option<Bytes>)> {
let Some(Spanned { v: path, span }) =
args.named::<Spanned<EcoString>>("theme")?
let Some(Spanned { v: path, span }) = args.named::<Spanned<EcoString>>("theme")?
else {
return Ok((None, None));
};

View File

@ -53,11 +53,9 @@ fn prepare(stream: TokenStream, item: &syn::ItemFn) -> Result<Func> {
};
let syn::Pat::Ident(syn::PatIdent {
by_ref: None,
mutability: None,
ident,
..
}) = &*typed.pat else {
by_ref: None, mutability: None, ident, ..
}) = &*typed.pat
else {
bail!(typed.pat, "expected identifier");
};