summaryrefslogtreecommitdiff
path: root/crates/typst-library
diff options
context:
space:
mode:
authorBeiri22 <beier1@hs-mittweida.de>2023-08-25 14:27:50 +0200
committerGitHub <noreply@github.com>2023-08-25 14:27:50 +0200
commitea469c2df6378e8ce860217cd100831ae6ee8d9f (patch)
tree1c515a45523117e0e371c02ea63f1c0d292944c5 /crates/typst-library
parent94df32a91973ace83f5f628db3daa19725be11e3 (diff)
calm down clippy even more (#1997)
Diffstat (limited to 'crates/typst-library')
-rw-r--r--crates/typst-library/src/compute/calc.rs2
-rw-r--r--crates/typst-library/src/layout/table.rs10
-rw-r--r--crates/typst-library/src/math/mod.rs14
-rw-r--r--crates/typst-library/src/meta/outline.rs3
-rw-r--r--crates/typst-library/src/text/raw.rs3
5 files changed, 14 insertions, 18 deletions
diff --git a/crates/typst-library/src/compute/calc.rs b/crates/typst-library/src/compute/calc.rs
index 81715007..ee4261af 100644
--- a/crates/typst-library/src/compute/calc.rs
+++ b/crates/typst-library/src/compute/calc.rs
@@ -859,7 +859,7 @@ fn minmax(
goal: Ordering,
) -> SourceResult<Value> {
let mut iter = values.into_iter();
- let Some(Spanned { v: mut extremum, ..}) = iter.next() else {
+ let Some(Spanned { v: mut extremum, .. }) = iter.next() else {
bail!(span, "expected at least one value");
};
diff --git a/crates/typst-library/src/layout/table.rs b/crates/typst-library/src/layout/table.rs
index 2cbaa9c3..11f37b8a 100644
--- a/crates/typst-library/src/layout/table.rs
+++ b/crates/typst-library/src/layout/table.rs
@@ -229,12 +229,10 @@ 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| {
- offset += extent;
- offset
- })
+ std::iter::once(Abs::zero()).chain(extents).map(move |extent| {
+ offset += extent;
+ offset
+ })
}
/// A value that can be configured per cell.
diff --git a/crates/typst-library/src/math/mod.rs b/crates/typst-library/src/math/mod.rs
index a2302785..f10850cf 100644
--- a/crates/typst-library/src/math/mod.rs
+++ b/crates/typst-library/src/math/mod.rs
@@ -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 id = world.book().select(family.as_str(), variant)?;
- let font = world.font(id)?;
- let _ = font.ttf().tables().math?.constants?;
- Some(font)
- })
- else {
+ 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 {
bail!(self.span(), "current font does not support math");
};
diff --git a/crates/typst-library/src/meta/outline.rs b/crates/typst-library/src/meta/outline.rs
index 69d39bdf..47caa0b5 100644
--- a/crates/typst-library/src/meta/outline.rs
+++ b/crates/typst-library/src/meta/outline.rs
@@ -214,7 +214,8 @@ impl Show for OutlineElem {
self.span(),
elem.clone().into_inner(),
self.fill(styles),
- )? else {
+ )?
+ else {
continue;
};
diff --git a/crates/typst-library/src/text/raw.rs b/crates/typst-library/src/text/raw.rs
index face0aa0..eb21e016 100644
--- a/crates/typst-library/src/text/raw.rs
+++ b/crates/typst-library/src/text/raw.rs
@@ -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));
};