Skip to content

Commit

Permalink
Verify spelling fixes pass check-spelling
Browse files Browse the repository at this point in the history
  • Loading branch information
jsoref authored Sep 24, 2024
2 parents 98d136a + 19e0f31 commit b0389b9
Show file tree
Hide file tree
Showing 70 changed files with 131 additions and 130 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
- run: cargo doc --workspace --no-deps

min-version:
name: Check mininum Rust version
name: Check minimum Rust version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion crates/typst-cli/src/terminal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ impl TermOut {
// We don't want to clear anything that is not a TTY.
if self.inner.stream.supports_color() {
// First, move the cursor up `lines` lines.
// Then, clear everything between between the cursor to end of screen.
// Then, clear everything between the cursor to end of screen.
let mut stream = self.inner.stream.lock();
write!(stream, "\x1B[1F\x1B[0J")?;
stream.flush()?;
Expand Down
2 changes: 1 addition & 1 deletion crates/typst-kit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ openssl = { workspace = true, optional = true }
[features]
default = ["fonts", "packages"]

# Add font loading utilitites
# Add font loading utilities
fonts = ["dep:fontdb", "fontdb/memmap", "fontdb/fontconfig"]

# Add generic downloading utilities
Expand Down
2 changes: 1 addition & 1 deletion crates/typst-kit/src/fonts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ impl FontSearcher {
let path = match &face.source {
Source::File(path) | Source::SharedFile(path, _) => path,
// We never add binary sources to the database, so there
// shouln't be any.
// shouldn't be any.
Source::Binary(_) => continue,
};

Expand Down
2 changes: 1 addition & 1 deletion crates/typst-kit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//! - For math: New Computer Modern Math
//! - For code: Deja Vu Sans Mono
//! - [download] contains functionality for making simple web requests with
//! status reporting, useful for downloading packages from package registires.
//! status reporting, useful for downloading packages from package registries.
//! It is enabled by the `downloads` feature flag, additionally the
//! `vendor-openssl` can be used on operating systems other than macOS and
//! Windows to vendor OpenSSL when building.
Expand Down
4 changes: 2 additions & 2 deletions crates/typst-kit/src/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ impl PackageStorage {
}
}

/// Returns a the path at which non-local packages should be stored when
/// Returns the path at which non-local packages should be stored when
/// downloaded.
pub fn package_cache_path(&self) -> Option<&Path> {
self.package_cache_path.as_deref()
}

/// Returns a the path at which local packages are stored.
/// Returns the path at which local packages are stored.
pub fn package_path(&self) -> Option<&Path> {
self.package_path.as_deref()
}
Expand Down
2 changes: 1 addition & 1 deletion crates/typst-pdf/src/font.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ pub fn write_font_descriptor<'a>(
#[typst_macros::time(name = "subset font")]
fn subset_font(font: &Font, glyph_remapper: &GlyphRemapper) -> Arc<Vec<u8>> {
let data = font.data();
// TODO: Fail export instead of unwrapping once export diagnoistics exist.
// TODO: Fail export instead of unwrapping once export diagnostics exist.
let subsetted = subsetter::subset(data, font.index(), glyph_remapper).unwrap();

let mut data = subsetted.as_ref();
Expand Down
2 changes: 1 addition & 1 deletion crates/typst-pdf/src/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ fn encode_alpha(raster: &RasterImage) -> (Vec<u8>, Filter) {
/// Encode an SVG into a chunk of PDF objects.
#[typst_macros::time(name = "encode svg")]
fn encode_svg(svg: &SvgImage) -> (Chunk, Ref) {
// TODO: Don't unwrap once we have export diagostics.
// TODO: Don't unwrap once we have export diagnostics.
svg2pdf::to_chunk(svg.tree(), svg2pdf::ConversionOptions::default()).unwrap()
}

Expand Down
2 changes: 1 addition & 1 deletion crates/typst-pdf/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ struct PdfChunk {
/// chunk, and should be remapped.
///
/// This is a constant (large enough to avoid collisions) and not
/// dependant on self.alloc to allow for better memoization of steps, if
/// dependent on self.alloc to allow for better memoization of steps, if
/// needed in the future.
const TEMPORARY_REFS_START: i32 = 1_000_000_000;

Expand Down
2 changes: 1 addition & 1 deletion crates/typst-syntax/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ impl<'a> TermItem<'a> {
}

node! {
/// A mathemathical equation: `$x$`, `$ x^2 $`.
/// A mathematical equation: `$x$`, `$ x^2 $`.
Equation
}

Expand Down
2 changes: 1 addition & 1 deletion crates/typst-syntax/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1789,7 +1789,7 @@ impl<'s> Parser<'s> {
fn next_non_trivia(lexer: &mut Lexer<'s>) -> SyntaxKind {
loop {
let next = lexer.next();
// Loop is terminatable, because SyntaxKind::End is not a trivia.
// Loop is terminable, because SyntaxKind::End is not a trivia.
if !next.is_trivia() {
break next;
}
Expand Down
4 changes: 2 additions & 2 deletions crates/typst/src/foundations/content.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ use crate::utils::{fat, singleton, LazyHash, SmallBitSet};
#[derive(Clone, Hash)]
#[allow(clippy::derived_hash_with_manual_eq)]
pub struct Content {
/// The partially element-dependant inner data.
/// The partially element-dependent inner data.
inner: Arc<Inner<dyn Bounds>>,
/// The element's source code location.
span: Span,
Expand All @@ -83,7 +83,7 @@ pub struct Content {
struct Inner<T: ?Sized + 'static> {
/// An optional label attached to the element.
label: Option<Label>,
/// The element's location which identifies it in the layouted output.
/// The element's location which identifies it in the laid-out output.
location: Option<Location>,
/// Manages the element during realization.
/// - If bit 0 is set, the element is prepared.
Expand Down
2 changes: 1 addition & 1 deletion crates/typst/src/foundations/func.rs
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ impl Func {
/// #show heading.where(level: 2): set text(blue)
/// = Section
/// == Subsection
/// === Sub-subection
/// === Sub-subsection
/// ```
#[func]
pub fn where_(
Expand Down
18 changes: 9 additions & 9 deletions crates/typst/src/introspection/locator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ use crate::introspection::{Introspector, Location};
/// its locator. When a layouter needs to call multiple sublayouters, we need to
/// make an explicit decision:
///
/// - Split: When we're layouting multiple distinct children (or other pieces of
/// - Split: When we're laying-out multiple distinct children (or other pieces of
/// content), we need to split up the locator with [`Locator::split`]. This
/// allows us to produce multiple new `Locator`s for the sublayouts. When we
/// split the locator, each sublocator will be a distinct entity and using it
/// to e.g. layout the same piece of figure content will yield distinctly
/// numbered figures.
///
/// - Relayout: When we're layouting the same content multiple times (e.g. when
/// - Relayout: When we're laying-out the same content multiple times (e.g. when
/// measuring something), we can call [`Locator::relayout`] to use the same
/// locator multiple times. This indicates to the compiler that it's actually
/// the same content. Using it to e.g. layout the same piece of figure content
Expand All @@ -40,7 +40,7 @@ use crate::introspection::{Introspector, Location};
/// for measurement and then discarded.
///
/// The `Locator` intentionally does not implement `Copy` and `Clone` so that it
/// can only be used once. This ensures that whenever we are layouting multiple
/// can only be used once. This ensures that whenever we are laying-out multiple
/// things, we make an explicit decision whether we want to split or relayout.
///
/// # How it works
Expand All @@ -62,7 +62,7 @@ use crate::introspection::{Introspector, Location};
/// - A very simple way to generate unique IDs would be to just increase a
/// counter for each element. In this setup, (1) is somewhat satisfied: In
/// principle, the counter will line up across iterations, but things start to
/// break down once we generate content dependant on introspection since the
/// break down once we generate content dependent on introspection since the
/// IDs generated for that new content will shift the IDs for all following
/// elements in the document. (2) is not satisfied since an edit in the middle
/// of the document shifts all later IDs. (3) is obviously not satisfied.
Expand All @@ -76,7 +76,7 @@ use crate::introspection::{Introspector, Location};
/// e.g. `#for _ in range(5) { figure(..) }`. To handle this case, we can then
/// disambiguate elements with the same span with an increasing counter. In
/// this setup, (1) is mostly satisfied: Unless we do stuff like generating
/// colliding counter updates dependant on introspection, things will line up.
/// colliding counter updates dependent on introspection, things will line up.
/// (2) is also reasonably well satisfied, as typical edits will only affect
/// the single element at the currently edited span. Only if we edit inside of
/// a function, loop, or similar construct, we will affect multiple elements.
Expand Down Expand Up @@ -114,7 +114,7 @@ use crate::introspection::{Introspector, Location};
/// locations assigned during measurement match up exactly with the locations of
/// real document elements. Without this guarantee, many introspection-driven
/// features (like counters, state, and citations) don't work correctly (since
/// they perform queries dependant on concrete locations).
/// they perform queries dependent on concrete locations).
///
/// This is all fine and good, but things get really tricky when the _user_
/// measures such introspecting content since the user isn't kindly managing
Expand Down Expand Up @@ -168,8 +168,8 @@ impl<'a> Locator<'a> {

/// Creates a new synthetic locator.
///
/// This can be used to create a new dependant layout based on an element.
/// This is used for layouting footnote entries based on the location
/// This can be used to create a new dependent layout based on an element.
/// This is used for laying-out footnote entries based on the location
/// of the associated footnote.
pub fn synthesize(location: Location) -> Self {
Self { local: location.hash(), outer: None }
Expand Down Expand Up @@ -255,7 +255,7 @@ impl<'a> SplitLocator<'a> {
/// throughout edits, improving incremental compilation performance.
///
/// A common choice for a key is the span of the content that will be
/// layouted with this locator.
/// laid-out with this locator.
pub fn next<K: Hash>(&mut self, key: &K) -> Locator<'a> {
self.next_inner(crate::utils::hash128(key))
}
Expand Down
2 changes: 1 addition & 1 deletion crates/typst/src/layout/axes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ where
}
}

/// The two layouting axes.
/// The two laying-out axes.
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum Axis {
/// The horizontal axis.
Expand Down
2 changes: 1 addition & 1 deletion crates/typst/src/layout/columns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pub struct ColumnsElem {
#[default(Ratio::new(0.04).into())]
pub gutter: Rel<Length>,

/// The content that should be layouted into the columns.
/// The content that should be laid-out into the columns.
#[required]
pub body: Content,
}
Expand Down
4 changes: 2 additions & 2 deletions crates/typst/src/layout/container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,12 +289,12 @@ impl Packed<InlineElem> {
}
}

/// Layouted items suitable for placing in a paragraph.
/// Laid-out items suitable for placing in a paragraph.
#[derive(Debug, Clone)]
pub enum InlineItem {
/// Absolute spacing between other items, and whether it is weak.
Space(Abs, bool),
/// Layouted inline-level content.
/// Laid-out inline-level content.
Frame(Frame),
}

Expand Down
2 changes: 1 addition & 1 deletion crates/typst/src/layout/corners.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ impl<T: Resolve> Resolve for Corners<T> {

impl<T: Fold> Fold for Corners<Option<T>> {
fn fold(self, outer: Self) -> Self {
// Usually, folding an inner `None` with an `outer` preferres the
// Usually, folding an inner `None` with an `outer` prefers the
// explicit `None`. However, here `None` means unspecified and thus
// we want `outer`, so we use `fold_or` to opt into such behavior.
self.zip(outer).map(|(inner, outer)| inner.fold_or(outer))
Expand Down
2 changes: 1 addition & 1 deletion crates/typst/src/layout/flow/collect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub enum Child<'a> {
Rel(Rel<Abs>, u8),
/// Fractional spacing.
Fr(Fr),
/// An already layouted line of a paragraph.
/// An already laid-out line of a paragraph.
Line(BumpBox<'a, LineChild>),
/// A potentially breakable block.
Block(BumpBox<'a, BlockChild<'a>>),
Expand Down
14 changes: 7 additions & 7 deletions crates/typst/src/layout/flow/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ use crate::World;

/// Layout content into multiple regions.
///
/// When just layouting into a single region, prefer [`layout_frame`].
/// When just laying-out into a single region, prefer [`layout_frame`].
pub fn layout_fragment(
engine: &mut Engine,
content: &Content,
Expand Down Expand Up @@ -63,7 +63,7 @@ pub fn layout_fragment(
/// For now, this just invokes normal layout on cycled smaller regions. However,
/// in the future, columns will be able to interact (e.g. through floating
/// figures), so this is already factored out because it'll be conceptually
/// different from just layouting into more smaller regions.
/// different from just laying-out into more smaller regions.
pub fn layout_fragment_with_columns(
engine: &mut Engine,
content: &Content,
Expand Down Expand Up @@ -274,7 +274,7 @@ struct FlowLayouter<'a, 'b, 'x, 'y> {
/// The initial size of `regions.size` that was available before we started
/// subtracting.
initial: Size,
/// Spacing and layouted blocks for the current region.
/// Spacing and laid-out blocks for the current region.
items: Vec<FlowItem<'a, 'b>>,
/// A queue of tags that will be attached to the next frame.
pending_tags: Vec<&'a Tag>,
Expand Down Expand Up @@ -309,7 +309,7 @@ enum FlowItem<'a, 'b> {
Absolute(Abs, u8),
/// Fractional spacing between other items.
Fractional(Fr),
/// A frame for a layouted block.
/// A frame for a laid-out block.
Frame {
/// The frame itself.
frame: Frame,
Expand Down Expand Up @@ -580,7 +580,7 @@ impl<'a, 'b, 'x, 'y> FlowLayouter<'a, 'b, 'x, 'y> {
// Select the closer placement, top or bottom.
if align_y.is_auto() {
// When the figure's vertical midpoint would be above the
// middle of the page if it were layouted in-flow, we use
// middle of the page if it were laid-out in-flow, we use
// top alignment. Otherwise, we use bottom alignment.
let used = self.regions.full - self.regions.size.y;
let half = (frame.height() + placed.clearance) / 2.0;
Expand Down Expand Up @@ -642,7 +642,7 @@ impl<'a, 'b, 'x, 'y> FlowLayouter<'a, 'b, 'x, 'y> {
}
}

/// Finisht the region, migrating all sticky items to the next one.
/// Finish the region, migrating all sticky items to the next one.
///
/// Returns whether we migrated into a last region.
fn finish_region_with_migration(&mut self) -> SourceResult<()> {
Expand Down Expand Up @@ -855,7 +855,7 @@ impl<'a, 'b, 'x, 'y> FlowLayouter<'a, 'b, 'x, 'y> {
Ok(())
}

/// Finish layouting and return the resulting fragment.
/// Finish laying-out and return the resulting fragment.
fn finish(mut self, regions: Regions) -> SourceResult<Fragment> {
if self.expand.y {
while !self.regions.backlog.is_empty() {
Expand Down
2 changes: 1 addition & 1 deletion crates/typst/src/layout/grid/cells.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ impl<'a> Cell<'a> {
/// Layout the cell into the given regions.
///
/// The `disambiguator` indicates which instance of this cell this should be
/// layouted as. For normal cells, it is always `0`, but for headers and
/// laid-out as. For normal cells, it is always `0`, but for headers and
/// footers, it indicates the index of the header/footer among all. See the
/// [`Locator`] docs for more details on the concepts behind this.
pub fn layout(
Expand Down
2 changes: 1 addition & 1 deletion crates/typst/src/layout/grid/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1309,7 +1309,7 @@ impl<'a> GridLayouter<'a> {
let width = self.cell_spanned_width(cell, x);
pod.size.x = width;

// Push the layouted frames into the individual output frames.
// Push the laid-out frames into the individual output frames.
let fragment =
cell.layout(engine, disambiguator, self.styles, pod)?;
for (output, frame) in outputs.iter_mut().zip(fragment) {
Expand Down
2 changes: 1 addition & 1 deletion crates/typst/src/layout/grid/rowspans.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ impl<'a> GridLayouter<'a> {
pod.full = region_full;
}

// Push the layouted frames directly into the finished frames.
// Push the laid-out frames directly into the finished frames.
let fragment = cell.layout(engine, disambiguator, self.styles, pod)?;
let (current_region, current_rrows) = current_region_data.unzip();
for ((i, finished), frame) in self
Expand Down
4 changes: 2 additions & 2 deletions crates/typst/src/layout/inline/collect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub enum Item<'a> {
Absolute(Abs, bool),
/// Fractional spacing between other items.
Fractional(Fr, Option<(&'a Packed<BoxElem>, Locator<'a>, StyleChain<'a>)>),
/// Layouted inline-level content.
/// Laid-out inline-level content.
Frame(Frame, StyleChain<'a>),
/// A tag.
Tag(&'a Tag),
Expand Down Expand Up @@ -76,7 +76,7 @@ impl<'a> Item<'a> {
self.textual().len()
}

/// The natural layouted width of the item.
/// The natural laid-out width of the item.
pub fn natural_width(&self) -> Abs {
match self {
Self::Text(shaped) => shaped.width,
Expand Down
4 changes: 2 additions & 2 deletions crates/typst/src/layout/inline/line.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const EN_DASH: char = '–';
const EM_DASH: char = '—';
const LINE_SEPARATOR: char = '\u{2028}'; // We use LS to distinguish justified breaks.

/// A layouted line, consisting of a sequence of layouted paragraph items that
/// A laid-out line, consisting of a sequence of laid-out paragraph items that
/// are mostly borrowed from the preparation phase. This type enables you to
/// measure the size of a line in a range before committing to building the
/// line's frame.
Expand Down Expand Up @@ -225,7 +225,7 @@ fn collect_items<'a>(
items
}

/// Calls `f` for the the BiDi-reordered ranges of a line.
/// Calls `f` for the BiDi-reordered ranges of a line.
fn reorder<F>(p: &Preparation, range: Range, mut f: F)
where
F: FnMut(Range, bool),
Expand Down
Loading

0 comments on commit b0389b9

Please sign in to comment.