Skip to content

Commit dcacddc

Browse files
authored
Fix typos in comments while reading the code (#10005)
1 parent 5ad1d99 commit dcacddc

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

internal/compiler/expression_tree.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1550,8 +1550,8 @@ pub struct BindingExpression {
15501550
pub expression: Expression,
15511551
/// The location of this expression in the source code
15521552
pub span: Option<SourceLocation>,
1553-
/// How deep is this binding declared in the hierarchy. When two binding are conflicting
1554-
/// for the same priority (because of two way binding), the lower priority wins.
1553+
/// How deep is this binding declared in the hierarchy. When two bindings are conflicting
1554+
/// for the same priority (because of a two way binding), the lower priority wins.
15551555
/// The priority starts at 1, and each level of inlining adds one to the priority.
15561556
/// 0 means the expression was added by some passes and it is not explicit in the source code
15571557
pub priority: i32,

internal/compiler/layout.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ fn init_fake_property(
453453
/// Internal representation of a grid layout
454454
#[derive(Debug, Clone)]
455455
pub struct GridLayout {
456-
/// All the elements will be layout within that element.
456+
/// All the elements which will be laid out within that element.
457457
pub elems: Vec<GridLayoutElement>,
458458

459459
pub geometry: LayoutGeometry,
@@ -475,7 +475,7 @@ impl GridLayout {
475475
/// Internal representation of a BoxLayout
476476
#[derive(Debug, Clone)]
477477
pub struct BoxLayout {
478-
/// Whether, this is a HorizontalLayout, otherwise a VerticalLayout
478+
/// Whether this is a HorizontalLayout or a VerticalLayout
479479
pub orientation: Orientation,
480480
pub elems: Vec<LayoutItem>,
481481
pub geometry: LayoutGeometry,

internal/core/properties.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ pub fn is_currently_tracking() -> bool {
389389
/// This structure erase the `B` type with a vtable.
390390
#[repr(C)]
391391
struct BindingHolder<B = ()> {
392-
/// Access to the list of binding which depends on this binding
392+
/// Access to the list of bindings which depend on this binding
393393
dependencies: Cell<usize>,
394394
/// The binding own the nodes used in the dependencies lists of the properties
395395
/// From which we depend.
@@ -490,10 +490,10 @@ fn alloc_binding_holder<T, B: BindingCallable<T> + 'static>(binding: B) -> *mut
490490
struct PropertyHandle {
491491
/// The handle can either be a pointer to a binding, or a pointer to the list of dependent properties.
492492
/// The two least significant bit of the pointer are flags, as the pointer will be aligned.
493-
/// The least significant bit (`0b01`) tells that the binding is borrowed. So no two reference to the
493+
/// The least significant bit (`0b01`) tells that the binding is borrowed. So no two references to the
494494
/// binding exist at the same time.
495495
/// The second to last bit (`0b10`) tells that the pointer points to a binding. Otherwise, it is the head
496-
/// node of the linked list of dependent binding
496+
/// node of the linked list of dependent bindings.
497497
handle: Cell<usize>,
498498
}
499499

@@ -511,12 +511,12 @@ impl core::fmt::Debug for PropertyHandle {
511511
}
512512

513513
impl PropertyHandle {
514-
/// The lock flag specify that we can get reference to the Cell or unsafe cell
514+
/// The lock flag specifies that we can get a reference to the Cell or unsafe cell
515515
fn lock_flag(&self) -> bool {
516516
self.handle.get() & 0b1 == 1
517517
}
518518
/// Sets the lock_flag.
519-
/// Safety: the lock flag must not be unset if there exist reference to what's inside the cell
519+
/// Safety: the lock flag must not be unset if there exist references to what's inside the cell
520520
unsafe fn set_lock_flag(&self, set: bool) {
521521
self.handle.set(if set { self.handle.get() | 0b1 } else { self.handle.get() & !0b1 })
522522
}
@@ -779,9 +779,9 @@ impl<T, F: Fn() -> T> Binding<T> for F {
779779
}
780780
}
781781

782-
/// A Property that allow binding that track changes
782+
/// A Property that allows a binding that tracks changes
783783
///
784-
/// Property can have an assigned value, or binding.
784+
/// Property can have an assigned value, or a binding.
785785
/// When a binding is assigned, it is lazily evaluated on demand
786786
/// when calling `get()`.
787787
/// When accessing another property from a binding evaluation,

internal/interpreter/api.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ impl std::fmt::Debug for Value {
208208
/// means that `Value::Number` can be converted to / from each of the said rust types
209209
///
210210
/// For `Value::Object` mapping to a rust `struct`, one can use [`declare_value_struct_conversion!`]
211-
/// And for `Value::EnumerationValue` which maps to a rust `enum`, one can use [`declare_value_struct_conversion!`]
211+
/// And for `Value::EnumerationValue` which maps to a rust `enum`, one can use [`declare_value_enum_conversion!`]
212212
macro_rules! declare_value_conversion {
213213
( $value:ident => [$($ty:ty),*] ) => {
214214
$(

0 commit comments

Comments
 (0)