From 098ef5acbb91723c4c806b23e5e5d85523fc88aa Mon Sep 17 00:00:00 2001 From: geekvest <126322776+geekvest@users.noreply.github.com> Date: Sun, 3 Mar 2024 22:50:19 +0800 Subject: [PATCH] Fix some comments (#3541) Signed-off-by: geekvest --- crates/typst-macros/src/lib.rs | 2 +- crates/typst-svg/src/lib.rs | 2 +- crates/typst-syntax/src/ast.rs | 2 +- crates/typst-syntax/src/parser.rs | 4 ++-- crates/typst/src/foundations/selector.rs | 2 +- crates/typst/src/introspection/query.rs | 2 +- crates/typst/src/layout/fr.rs | 2 +- crates/typst/src/layout/inline/shaping.rs | 2 +- crates/typst/src/loading/xml.rs | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/crates/typst-macros/src/lib.rs b/crates/typst-macros/src/lib.rs index f92230eff..35c48b4a3 100644 --- a/crates/typst-macros/src/lib.rs +++ b/crates/typst-macros/src/lib.rs @@ -358,7 +358,7 @@ pub fn symbols(stream: BoundaryStream) -> BoundaryStream { /// - `#[time(span = ..)]` to record the span, which will be used for the /// `EventKey`. /// -/// By default, all tracing is ommited using the `wasm32` target flag. +/// By default, all tracing is omitted using the `wasm32` target flag. /// This is done to avoid bloating the web app which doesn't need tracing. /// /// ```ignore diff --git a/crates/typst-svg/src/lib.rs b/crates/typst-svg/src/lib.rs index 4d5422964..ad8faf290 100644 --- a/crates/typst-svg/src/lib.rs +++ b/crates/typst-svg/src/lib.rs @@ -1279,7 +1279,7 @@ impl Deduplicator { }) } - /// Iterate over the the elements alongside their ids. + /// Iterate over the elements alongside their ids. fn iter(&self) -> impl Iterator { self.vec .iter() diff --git a/crates/typst-syntax/src/ast.rs b/crates/typst-syntax/src/ast.rs index fc689a689..840024f79 100644 --- a/crates/typst-syntax/src/ast.rs +++ b/crates/typst-syntax/src/ast.rs @@ -1271,7 +1271,7 @@ node! { } impl<'a> Spread<'a> { - /// The spreaded expression. + /// The spread expression. /// /// This should only be accessed if this `Spread` is contained in an /// `ArrayItem`, `DictItem`, or `Arg`. diff --git a/crates/typst-syntax/src/parser.rs b/crates/typst-syntax/src/parser.rs index 4785b8a19..e5ecbc11f 100644 --- a/crates/typst-syntax/src/parser.rs +++ b/crates/typst-syntax/src/parser.rs @@ -1161,7 +1161,7 @@ fn array_or_dict_item(p: &mut Parser, state: &mut GroupState) { let m = p.marker(); if p.eat_if(SyntaxKind::Dots) { - // Parses a spreaded item: `..item`. + // Parses a spread item: `..item`. code_expr(p); p.wrap(m, SyntaxKind::Spread); state.maybe_just_parens = false; @@ -1249,7 +1249,7 @@ fn args(p: &mut Parser) { fn arg<'s>(p: &mut Parser<'s>, seen: &mut HashSet<&'s str>) { let m = p.marker(); - // Parses a spreaded argument: `..args`. + // Parses a spread argument: `..args`. if p.eat_if(SyntaxKind::Dots) { code_expr(p); p.wrap(m, SyntaxKind::Spread); diff --git a/crates/typst/src/foundations/selector.rs b/crates/typst/src/foundations/selector.rs index 747ae1a96..28c1967aa 100644 --- a/crates/typst/src/foundations/selector.rs +++ b/crates/typst/src/foundations/selector.rs @@ -181,7 +181,7 @@ impl Selector { Self::Or(others.into_iter().chain(Some(self)).collect()) } - /// Selects all elements that match this and all of the the other selectors. + /// Selects all elements that match this and all of the other selectors. #[func] pub fn and( self, diff --git a/crates/typst/src/introspection/query.rs b/crates/typst/src/introspection/query.rs index a698a2679..c80fe4ef0 100644 --- a/crates/typst/src/introspection/query.rs +++ b/crates/typst/src/introspection/query.rs @@ -25,7 +25,7 @@ use crate::introspection::Location; /// /// - On the first page the query for all headings before the current location /// yields an empty array: There are no previous headings. We check for this -/// case and and just display "Typst Academy". +/// case and just display "Typst Academy". /// /// - For the second page, we retrieve the last element from the query's result. /// This is the latest heading before the current position and as such, it is diff --git a/crates/typst/src/layout/fr.rs b/crates/typst/src/layout/fr.rs index 23f5cf620..6621e6bcd 100644 --- a/crates/typst/src/layout/fr.rs +++ b/crates/typst/src/layout/fr.rs @@ -8,7 +8,7 @@ use crate::foundations::{repr, ty, Repr}; use crate::layout::Abs; use crate::util::{Numeric, Scalar}; -/// Defines how the the remaining space in a layout is distributed. +/// Defines how the remaining space in a layout is distributed. /// /// Each fractionally sized element gets space based on the ratio of its /// fraction to the sum of all fractions. diff --git a/crates/typst/src/layout/inline/shaping.rs b/crates/typst/src/layout/inline/shaping.rs index f914d347a..586d89e7d 100644 --- a/crates/typst/src/layout/inline/shaping.rs +++ b/crates/typst/src/layout/inline/shaping.rs @@ -920,7 +920,7 @@ fn nbsp_delta(font: &Font) -> Option { Some(font.advance(nbsp)? - font.advance(space)?) } -/// Process the language and and region of a style chain into a +/// Process the language and region of a style chain into a /// rustybuzz-compatible BCP 47 language. fn language(styles: StyleChain) -> rustybuzz::Language { let mut bcp: EcoString = TextElem::lang_in(styles).as_str().into(); diff --git a/crates/typst/src/loading/xml.rs b/crates/typst/src/loading/xml.rs index fde7d55a2..1c494e788 100644 --- a/crates/typst/src/loading/xml.rs +++ b/crates/typst/src/loading/xml.rs @@ -12,7 +12,7 @@ use crate::World; /// /// The XML file is parsed into an array of dictionaries and strings. XML nodes /// can be elements or strings. Elements are represented as dictionaries with -/// the the following keys: +/// the following keys: /// /// - `tag`: The name of the element as a string. /// - `attrs`: A dictionary of the element's attributes as strings.