Skip to content

Commit 9e67fbd

Browse files
committed
docs(rust): Fix typos and grammar mistakes in Rust documentation comments (#12715)
1 parent ca760ca commit 9e67fbd

File tree

17 files changed

+21
-21
lines changed

17 files changed

+21
-21
lines changed

crates/oxc_allocator/src/vec2/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ where
274274
///
275275
/// # Indexing
276276
///
277-
/// The `Vec` type allows to access values by index, because it implements the
277+
/// The `Vec` type allows accessing values by index, because it implements the
278278
/// [`Index`] trait. An example will be more explicit:
279279
///
280280
/// ```

crates/oxc_ast/src/ast/js.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ pub struct ArrayExpression<'a> {
320320
}
321321

322322
inherit_variants! {
323-
/// Represents a element in an array literal.
323+
/// Represents an element in an array literal.
324324
///
325325
/// Inherits variants from [`Expression`]. See [`ast` module docs] for explanation of inheritance.
326326
///

crates/oxc_ast/src/ast/ts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ pub enum TSLiteral<'a> {
212212

213213
/// TypeScript Type
214214
///
215-
/// This is the root-level type for TypeScript types, kind of like [`Expression`] is for
215+
/// This is the root-level type for TypeScript types, similar to how [`Expression`] is for
216216
/// expressions.
217217
///
218218
/// ## Examples

crates/oxc_ast/src/trivia.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Trivias such as comments and irregular whitespaces
1+
//! Trivia such as comments and irregular whitespaces
22
#![expect(missing_docs)] // FIXME
33

44
use std::{

crates/oxc_data_structures/src/inline_string.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ impl<const CAPACITY: usize, Len: UnsignedInt> InlineString<CAPACITY, Len> {
4646
);
4747
};
4848

49-
/// Create empty [`InlineString`].
49+
/// Create an empty [`InlineString`].
5050
#[inline]
5151
pub fn new() -> Self {
5252
const { Self::ASSERTS };

crates/oxc_data_structures/src/stack/sparse.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use super::{NonEmptyStack, Stack};
2323
///
2424
/// e.g. if `T` is 24 bytes, and 90% of stack entries have no values:
2525
/// * `Vec<Option<T>>` is 24 bytes per entry (or 32 bytes if `T` has no niche).
26-
/// * `NonEmptyStack<Option<T>>` is same.
26+
/// * `NonEmptyStack<Option<T>>` is the same.
2727
/// * `SparseStack<T>` is 4 bytes per entry.
2828
///
2929
/// When the stack grows and reallocates, `SparseStack` has less memory to copy, which is a performance

crates/oxc_ecmascript/src/constant_evaluation/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub trait ConstantEvaluation<'a>: MayHaveSideEffects<'a> {
3636
///
3737
/// - target_ty: How the result will be used.
3838
/// For example, if the result will be converted to a boolean,
39-
/// passing `Some(ValueType::Boolean)` will allow to utilize that information.
39+
/// passing `Some(ValueType::Boolean)` will allow us to utilize that information.
4040
fn evaluate_value_to(
4141
&self,
4242
ctx: &impl ConstantEvaluationCtx<'a>,

crates/oxc_formatter/src/formatter/builders.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ pub const fn empty_line() -> Line {
146146
///
147147
/// # Examples
148148
///
149-
/// The line breaks are emitted as spaces if the enclosing `Group` fits on a a single line:
149+
/// The line breaks are emitted as spaces if the enclosing `Group` fits on a single line:
150150
/// ```
151151
/// use biome_formatter::{format, format_args};
152152
/// use biome_formatter::prelude::*;
@@ -863,7 +863,7 @@ impl std::fmt::Debug for Indent<'_, '_> {
863863
/// text("Aligned, and indented"),
864864
/// dedent(&format_args![
865865
/// hard_line_break(),
866-
/// text("aligned, not Intended"),
866+
/// text("aligned, not indented"),
867867
/// ]),
868868
/// ])
869869
/// ]
@@ -872,7 +872,7 @@ impl std::fmt::Debug for Indent<'_, '_> {
872872
/// ]
873873
/// )?;
874874
/// assert_eq!(
875-
/// "root\n Indented\n Indented and aligned\n Indented, not aligned\n Aligned\n Aligned, and indented\n aligned, not Intended\nroot level",
875+
/// "root\n Indented\n Indented and aligned\n Indented, not aligned\n Aligned\n Aligned, and indented\n aligned, not indented\nroot level",
876876
/// elements.print()?.as_code()
877877
/// );
878878
/// # Ok(())

crates/oxc_formatter/src/write/utils/string_utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ impl FormatLiteralStringToken<'_> {
120120
/// The function determines the preferred quote and alternate quote.
121121
/// The preferred quote is the one that comes from the formatter options. The alternate quote is the other one.
122122
///
123-
/// We check how many preferred quotes we have inside the content. If this number is greater then the
123+
/// We check how many preferred quotes we have inside the content. If this number is greater than the
124124
/// number alternate quotes that we have inside the content,
125125
/// then we swap them, so we can reduce the number of escaped quotes.
126126
///

crates/oxc_isolated_declarations/src/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ impl<'a> IsolatedDeclarations<'a> {
6666
})
6767
}
6868

69-
/// Convert a a computed property key to a static property key when possible
69+
/// Convert a computed property key to a static property key when possible
7070
fn transform_property_key(&self, key: &PropertyKey<'a>) -> PropertyKey<'a> {
7171
match key {
7272
// ["string"] -> string

0 commit comments

Comments
 (0)