From f1025071edfb787309a75d4bb68bec0c2bd906bb Mon Sep 17 00:00:00 2001 From: Laurenz Date: Sat, 24 Jun 2023 15:05:59 +0200 Subject: Tidy up --- library/src/math/attach.rs | 7 +++---- library/src/math/row.rs | 8 ++++---- library/src/math/underover.rs | 3 +-- library/src/meta/reference.rs | 2 -- library/src/prelude.rs | 2 +- 5 files changed, 9 insertions(+), 13 deletions(-) (limited to 'library/src') diff --git a/library/src/math/attach.rs b/library/src/math/attach.rs index 158e5f0d..fedeb908 100644 --- a/library/src/math/attach.rs +++ b/library/src/math/attach.rs @@ -125,11 +125,10 @@ pub struct LimitsElem { #[required] pub body: Content, - /// Whether to apply limits in inline equations. + /// Whether to also force limits in inline equations. /// - /// It is useful to disable this setting - /// in most cases of applying limits globally - /// (inside show rules or new elements) + /// When applying limits globally (e.g., through a show rule), it is + /// typically a good idea to disable this. #[default(true)] pub inline: bool, } diff --git a/library/src/math/row.rs b/library/src/math/row.rs index 1704dbf1..687f82b8 100644 --- a/library/src/math/row.rs +++ b/library/src/math/row.rs @@ -85,11 +85,11 @@ impl MathRow { self.0.iter() } - /// It is very unintuitive, but in current state of things - /// `MathRow` can contain several actual rows. - /// That function deconstructs it to "single" rows. + /// Extract the sublines of the row. /// - /// Hopefully that cloner is only a temporary hack + /// It is very unintuitive, but in current state of things, a `MathRow` can + /// contain several actual rows. That function deconstructs it to "single" + /// rows. Hopefully this is only a temporary hack. pub fn rows(&self) -> Vec { self.0 .split(|frag| matches!(frag, MathFragment::Linebreak)) diff --git a/library/src/math/underover.rs b/library/src/math/underover.rs index df3ba582..29c0e543 100644 --- a/library/src/math/underover.rs +++ b/library/src/math/underover.rs @@ -206,9 +206,8 @@ fn layout( let body = body.into_fragment(ctx); let glyph = GlyphFragment::new(ctx, c, span); let stretched = glyph.stretch_horizontal(ctx, body.width(), Abs::zero()); - let body = MathRow::new(vec![body]); - let mut rows = vec![body, stretched.into()]; + let mut rows = vec![MathRow::new(vec![body]), stretched.into()]; ctx.style(if reverse { ctx.style.for_subscript() } else { diff --git a/library/src/meta/reference.rs b/library/src/meta/reference.rs index 457085fd..26961ec5 100644 --- a/library/src/meta/reference.rs +++ b/library/src/meta/reference.rs @@ -1,5 +1,3 @@ -use typst::diag::Hint; - use super::{BibliographyElem, CiteElem, Counter, Figurable, Numbering}; use crate::prelude::*; use crate::text::TextElem; diff --git a/library/src/prelude.rs b/library/src/prelude.rs index f0dda5c8..1a51b2a3 100644 --- a/library/src/prelude.rs +++ b/library/src/prelude.rs @@ -10,7 +10,7 @@ pub use comemo::{Track, Tracked, TrackedMut}; #[doc(no_inline)] pub use ecow::{eco_format, EcoString}; #[doc(no_inline)] -pub use typst::diag::{bail, error, At, SourceResult, StrResult}; +pub use typst::diag::{bail, error, At, Hint, SourceResult, StrResult}; #[doc(no_inline)] pub use typst::doc::*; #[doc(no_inline)] -- cgit v1.2.3