Fix spelling typos. (#3965)

This commit is contained in:
Eric Roman
2025-05-16 23:49:57 -07:00
committed by GitHub
parent a42fa452fc
commit 3903867f82
21 changed files with 31 additions and 31 deletions

View File

@@ -31,7 +31,7 @@ pub const fn const_concat(
let mut i = 0; let mut i = 0;
// have it iterate over bytes manually, because, again, // have it iterate over bytes manually, because, again,
// no mutable refernces in const fns // no mutable references in const fns
while i < x.len() { while i < x.len() {
buffer[position] = x[i]; buffer[position] = x[i];
position += 1; position += 1;
@@ -59,7 +59,7 @@ pub const fn const_concat_with_prefix(
let mut i = 0; let mut i = 0;
// have it iterate over bytes manually, because, again, // have it iterate over bytes manually, because, again,
// no mutable refernces in const fns // no mutable references in const fns
while i < x.len() { while i < x.len() {
buffer[position] = x[i]; buffer[position] = x[i];
position += 1; position += 1;
@@ -116,7 +116,7 @@ pub const fn const_concat_with_separator(
let mut i = 0; let mut i = 0;
// have it iterate over bytes manually, because, again, // have it iterate over bytes manually, because, again,
// no mutable refernces in const fns // no mutable references in const fns
while i < x.len() { while i < x.len() {
buffer[position] = x[i]; buffer[position] = x[i];
position += 1; position += 1;

View File

@@ -7,7 +7,7 @@ pub fn main() {
fmt() fmt()
.with_writer( .with_writer(
// To avoide trace events in the browser from showing their // To avoid trace events in the browser from showing their
// JS backtrace, which is very annoying, in my opinion // JS backtrace, which is very annoying, in my opinion
MakeConsoleWriter::default() MakeConsoleWriter::default()
.map_trace_level_to(tracing::Level::DEBUG), .map_trace_level_to(tracing::Level::DEBUG),

View File

@@ -561,7 +561,7 @@ fn ShowCounters() -> impl IntoView {
// //
// However, upon `Reset Counters`, the mode from which the reset // However, upon `Reset Counters`, the mode from which the reset
// was issued will result in the rendering be reflected as such, so // was issued will result in the rendering be reflected as such, so
// if the intial state was SSR, resetting under CSR will result in // if the initial state was SSR, resetting under CSR will result in
// the CSR counters be rendered after. However for the intents and // the CSR counters be rendered after. However for the intents and
// purpose for the testing only the CSR is cared for. // purpose for the testing only the CSR is cared for.
// //

View File

@@ -590,7 +590,7 @@ where
/// Returns an Axum [Handler](axum::handler::Handler) that listens for a `GET` request and tries /// Returns an Axum [Handler](axum::handler::Handler) that listens for a `GET` request and tries
/// to route it using [leptos_router], serving an HTML stream of your application. /// to route it using [leptos_router], serving an HTML stream of your application.
/// ///
/// This version allows us to pass Axum State/Extension/Extractor or other infro from Axum or network /// This version allows us to pass Axum State/Extension/Extractor or other info from Axum or network
/// layers above Leptos itself. To use it, you'll need to write your own handler function that provides /// layers above Leptos itself. To use it, you'll need to write your own handler function that provides
/// the data to leptos in a closure. An example is below /// the data to leptos in a closure. An example is below
/// ``` /// ```
@@ -796,7 +796,7 @@ where
/// This stream will pause at each `<Suspense/>` node and wait for it to resolve before /// This stream will pause at each `<Suspense/>` node and wait for it to resolve before
/// sending down its HTML. The app will become interactive once it has fully loaded. /// sending down its HTML. The app will become interactive once it has fully loaded.
/// ///
/// This version allows us to pass Axum State/Extension/Extractor or other infro from Axum or network /// This version allows us to pass Axum State/Extension/Extractor or other info from Axum or network
/// layers above Leptos itself. To use it, you'll need to write your own handler function that provides /// layers above Leptos itself. To use it, you'll need to write your own handler function that provides
/// the data to leptos in a closure. An example is below /// the data to leptos in a closure. An example is below
/// ``` /// ```
@@ -1022,7 +1022,7 @@ where
/// to route it using [leptos_router], asynchronously rendering an HTML page after all /// to route it using [leptos_router], asynchronously rendering an HTML page after all
/// `async` resources have loaded. /// `async` resources have loaded.
/// ///
/// This version allows us to pass Axum State/Extension/Extractor or other infro from Axum or network /// This version allows us to pass Axum State/Extension/Extractor or other info from Axum or network
/// layers above Leptos itself. To use it, you'll need to write your own handler function that provides /// layers above Leptos itself. To use it, you'll need to write your own handler function that provides
/// the data to leptos in a closure. An example is below /// the data to leptos in a closure. An example is below
/// ``` /// ```
@@ -1089,7 +1089,7 @@ where
/// to route it using [leptos_router], asynchronously rendering an HTML page after all /// to route it using [leptos_router], asynchronously rendering an HTML page after all
/// `async` resources have loaded. /// `async` resources have loaded.
/// ///
/// This version allows us to pass Axum State/Extension/Extractor or other infro from Axum or network /// This version allows us to pass Axum State/Extension/Extractor or other info from Axum or network
/// layers above Leptos itself. To use it, you'll need to write your own handler function that provides /// layers above Leptos itself. To use it, you'll need to write your own handler function that provides
/// the data to leptos in a closure. An example is below /// the data to leptos in a closure. An example is below
/// ``` /// ```

View File

@@ -47,7 +47,7 @@ type BoxedChildrenFn = Box<dyn Fn() -> AnyView + Send>;
/// ///
/// Different component types take different types for their `children` prop, some of which cannot /// Different component types take different types for their `children` prop, some of which cannot
/// be directly constructed. Using `ToChildren` allows the component user to pass children without /// be directly constructed. Using `ToChildren` allows the component user to pass children without
/// explicity constructing the correct type. /// explicitly constructing the correct type.
/// ///
/// ## Examples /// ## Examples
/// ///

View File

@@ -255,7 +255,7 @@ where
) -> Result<Self, serde_qs::Error>; ) -> Result<Self, serde_qs::Error>;
} }
/// Errors that can arise when coverting from an HTML event or form into a Rust data type. /// Errors that can arise when converting from an HTML event or form into a Rust data type.
#[derive(Error, Debug)] #[derive(Error, Debug)]
pub enum FromFormDataError { pub enum FromFormDataError {
/// Could not find a `<form>` connected to the event. /// Could not find a `<form>` connected to the event.

View File

@@ -8,7 +8,7 @@ use std::sync::Arc;
/// ///
/// Useful for inserting modals and tooltips outside of a cropping layout. /// Useful for inserting modals and tooltips outside of a cropping layout.
/// If no mount point is given, the portal is inserted in `document.body`; /// If no mount point is given, the portal is inserted in `document.body`;
/// it is wrapped in a `<div>` unless `is_svg` is `true` in which case it's wrappend in a `<g>`. /// it is wrapped in a `<div>` unless `is_svg` is `true` in which case it's wrapped in a `<g>`.
/// Setting `use_shadow` to `true` places the element in a shadow root to isolate styles. /// Setting `use_shadow` to `true` places the element in a shadow root to isolate styles.
#[cfg_attr(feature = "tracing", tracing::instrument(level = "trace", skip_all))] #[cfg_attr(feature = "tracing", tracing::instrument(level = "trace", skip_all))]
#[component] #[component]

View File

@@ -64,7 +64,7 @@ impl<T> ArcLocalResource<T> {
pending().await pending().await
} else { } else {
// LocalResources that are immediately available can cause a hydration error, // LocalResources that are immediately available can cause a hydration error,
// because the future *looks* like it is alredy ready (and therefore would // because the future *looks* like it is already ready (and therefore would
// already have been rendered to html on the server), but in fact was ignored // already have been rendered to html on the server), but in fact was ignored
// on the server. the simplest way to avoid this is to ensure that we always // on the server. the simplest way to avoid this is to ensure that we always
// wait a tick before resolving any value for a localresource. // wait a tick before resolving any value for a localresource.
@@ -298,7 +298,7 @@ impl<T> LocalResource<T> {
pending().await pending().await
} else { } else {
// LocalResources that are immediately available can cause a hydration error, // LocalResources that are immediately available can cause a hydration error,
// because the future *looks* like it is alredy ready (and therefore would // because the future *looks* like it is already ready (and therefore would
// already have been rendered to html on the server), but in fact was ignored // already have been rendered to html on the server), but in fact was ignored
// on the server. the simplest way to avoid this is to ensure that we always // on the server. the simplest way to avoid this is to ensure that we always
// wait a tick before resolving any value for a localresource. // wait a tick before resolving any value for a localresource.

View File

@@ -29,7 +29,7 @@ use std::{
/// values that depend on it that it has changed. /// values that depend on it that it has changed.
/// ///
/// This is an arena-allocated type, which is `Copy` and is disposed when its reactive /// This is an arena-allocated type, which is `Copy` and is disposed when its reactive
/// [`Owner`](crate::owner::Owner) cleans up. For a reference-counted signal that livesas /// [`Owner`](crate::owner::Owner) cleans up. For a reference-counted signal that lives as
/// as long as a reference to it is alive, see [`ArcAsyncDerived`]. /// as long as a reference to it is alive, see [`ArcAsyncDerived`].
/// ///
/// ## Examples /// ## Examples

View File

@@ -15,7 +15,7 @@ pub struct MemoInner<T, S>
where where
S: Storage<T>, S: Storage<T>,
{ {
/// Must always be aquired *after* the reactivity lock /// Must always be acquired *after* the reactivity lock
pub(crate) value: Arc<RwLock<Option<S::Wrapped>>>, pub(crate) value: Arc<RwLock<Option<S::Wrapped>>>,
#[allow(clippy::type_complexity)] #[allow(clippy::type_complexity)]
pub(crate) fun: Arc<dyn Fn(Option<T>) -> (T, bool) + Send + Sync>, pub(crate) fun: Arc<dyn Fn(Option<T>) -> (T, bool) + Send + Sync>,
@@ -137,7 +137,7 @@ where
}) })
}); });
// Two locks are aquired, so order matters. // Two locks are acquired, so order matters.
let reactivity_lock = self.reactivity.write().or_poisoned(); let reactivity_lock = self.reactivity.write().or_poisoned();
{ {
// Safety: Can block endlessly if the user is has a ReadGuard on the value // Safety: Can block endlessly if the user is has a ReadGuard on the value

View File

@@ -27,7 +27,7 @@ use std::{fmt::Debug, hash::Hash, panic::Location};
/// not re-run the calculation when a source signal changes until they are read again. /// not re-run the calculation when a source signal changes until they are read again.
/// ///
/// This is an arena-allocated type, which is `Copy` and is disposed when its reactive /// This is an arena-allocated type, which is `Copy` and is disposed when its reactive
/// [`Owner`](crate::owner::Owner) cleans up. For a reference-counted signal that livesas /// [`Owner`](crate::owner::Owner) cleans up. For a reference-counted signal that lives as
/// as long as a reference to it is alive, see [`ArcMemo`]. /// as long as a reference to it is alive, see [`ArcMemo`].
/// ///
/// ``` /// ```

View File

@@ -1,4 +1,4 @@
//! The reactive ownership model, which manages effect cancelation, cleanups, and arena allocation. //! The reactive ownership model, which manages effect cancellation, cleanups, and arena allocation.
#[cfg(feature = "hydration")] #[cfg(feature = "hydration")]
use hydration_context::SharedContext; use hydration_context::SharedContext;
@@ -32,7 +32,7 @@ pub use storage::*;
pub use stored_value::{store_value, FromLocal, StoredValue}; pub use stored_value::{store_value, FromLocal, StoredValue};
/// A reactive owner, which manages /// A reactive owner, which manages
/// 1) the cancelation of [`Effect`](crate::effect::Effect)s, /// 1) the cancellation of [`Effect`](crate::effect::Effect)s,
/// 2) providing and accessing environment data via [`provide_context`] and [`use_context`], /// 2) providing and accessing environment data via [`provide_context`] and [`use_context`],
/// 3) running cleanup functions defined via [`Owner::on_cleanup`], and /// 3) running cleanup functions defined via [`Owner::on_cleanup`], and
/// 4) an arena storage system to provide `Copy` handles via [`ArenaItem`], which is what allows /// 4) an arena storage system to provide `Copy` handles via [`ArenaItem`], which is what allows

View File

@@ -9,7 +9,7 @@ use std::{
/// An optional value that can always be sent between threads, even if its inner value /// An optional value that can always be sent between threads, even if its inner value
/// in the `Some(_)` case would not be threadsafe. /// in the `Some(_)` case would not be threadsafe.
/// ///
/// This struct can be derefenced to `Option<T>`. /// This struct can be dereferenced to `Option<T>`.
/// ///
/// If it has been given a local (`!Send`) value, that value is wrapped in a [`SendWrapper`], which /// If it has been given a local (`!Send`) value, that value is wrapped in a [`SendWrapper`], which
/// allows sending it between threads but will panic if it is accessed or updated from a /// allows sending it between threads but will panic if it is accessed or updated from a

View File

@@ -22,7 +22,7 @@ use std::{
/// allowing you to read or write directly to one of its field. /// allowing you to read or write directly to one of its field.
/// ///
/// Tracking the mapped signal tracks changes to *any* part of the signal, and updating the signal notifies /// Tracking the mapped signal tracks changes to *any* part of the signal, and updating the signal notifies
/// and notifies *all* depenendencies of the signal. This is not a mechanism for fine-grained reactive updates /// and notifies *all* dependencies of the signal. This is not a mechanism for fine-grained reactive updates
/// to more complex data structures. Instead, it allows you to provide a signal-like API for wrapped types /// to more complex data structures. Instead, it allows you to provide a signal-like API for wrapped types
/// without exposing the original type directly to users. /// without exposing the original type directly to users.
pub struct ArcMappedSignal<T> { pub struct ArcMappedSignal<T> {
@@ -224,7 +224,7 @@ where
/// allowing you to read or write directly to one of its field. /// allowing you to read or write directly to one of its field.
/// ///
/// Tracking the mapped signal tracks changes to *any* part of the signal, and updating the signal notifies /// Tracking the mapped signal tracks changes to *any* part of the signal, and updating the signal notifies
/// and notifies *all* depenendencies of the signal. This is not a mechanism for fine-grained reactive updates /// and notifies *all* dependencies of the signal. This is not a mechanism for fine-grained reactive updates
/// to more complex data structures. Instead, it allows you to provide a signal-like API for wrapped types /// to more complex data structures. Instead, it allows you to provide a signal-like API for wrapped types
/// without exposing the original type directly to users. /// without exposing the original type directly to users.
pub struct MappedSignal<T, S = SyncStorage> { pub struct MappedSignal<T, S = SyncStorage> {

View File

@@ -643,7 +643,7 @@ pub trait IntoInner {
/// The type of the value contained in the signal. /// The type of the value contained in the signal.
type Value; type Value;
/// Returns the inner value if this is the only reference to to the signal. /// Returns the inner value if this is the only reference to the signal.
/// Otherwise, returns `None` and drops this reference. /// Otherwise, returns `None` and drops this reference.
/// # Panics /// # Panics
/// Panics if the inner lock is poisoned. /// Panics if the inner lock is poisoned.

View File

@@ -5,7 +5,7 @@ Stores are a data structure for nested reactivity.
The [`reactive_graph`](https://crates.io/crates/reactive_graph) crate provides primitives for fine-grained reactivity The [`reactive_graph`](https://crates.io/crates/reactive_graph) crate provides primitives for fine-grained reactivity
via signals, memos, and effects. via signals, memos, and effects.
This crate extends that reactivity to support reactive access to nested dested, without the need to create nested signals. This crate extends that reactivity to support reactive access to nested structs, without the need to create nested signals.
Using the `#[derive(Store)]` macro on a struct creates a series of getters that allow accessing each field. Individual fields Using the `#[derive(Store)]` macro on a struct creates a series of getters that allow accessing each field. Individual fields
can then be read as if they were signals. Changes to parents will notify their children, but changing one sibling field will can then be read as if they were signals. Changes to parents will notify their children, but changing one sibling field will

View File

@@ -24,7 +24,7 @@ where
/// ///
/// This returns `None` if the subfield is currently `None`, /// This returns `None` if the subfield is currently `None`,
/// and a new store subfield with the inner value if it is `Some`. This can be used in some /// and a new store subfield with the inner value if it is `Some`. This can be used in some
/// other reactive context, which will cause it to re-run if the field toggles betwen `None` /// other reactive context, which will cause it to re-run if the field toggles between `None`
/// and `Some(_)`. /// and `Some(_)`.
fn map<U>( fn map<U>(
self, self,

View File

@@ -295,7 +295,7 @@ mod tests {
assert!(!is_active_for("/else/where", "/", f)); assert!(!is_active_for("/else/where", "/", f));
assert!(!is_active_for("/no/where/", "/", f)); assert!(!is_active_for("/no/where/", "/", f));
// mismatch either side all cominations of trailing slashes // mismatch either side all combinations of trailing slashes
assert!(!is_active_for("/level", "/item", f)); assert!(!is_active_for("/level", "/item", f));
assert!(!is_active_for("/level", "/item/", f)); assert!(!is_active_for("/level", "/item/", f));
assert!(!is_active_for("/level/", "/item", f)); assert!(!is_active_for("/level/", "/item", f));
@@ -383,7 +383,7 @@ mod tests {
// //
// assert!(is_active_for("/", "/item", true)); // assert!(is_active_for("/", "/item", true));
// //
// Perhaps there needs to be a flag such that aria-curently applies only the _same level_, e.g // Perhaps there needs to be a flag such that aria-curent applies only the _same level_, e.g
// assert!(is_same_level("/", "/")) // assert!(is_same_level("/", "/"))
// assert!(is_same_level("/", "/anything")) // assert!(is_same_level("/", "/anything"))
// assert!(!is_same_level("/", "/some/")) // assert!(!is_same_level("/", "/some/"))

View File

@@ -1,4 +1,4 @@
// The trybuild output has slightly different error message ouptut for // The trybuild output has slightly different error message output for
// different combinations of features. Since tests are run with `test-all-features` // different combinations of features. Since tests are run with `test-all-features`
// multiple combinations of features are tested. This ensures this file is only // multiple combinations of features are tested. This ensures this file is only
// run when **only** the browser feature is enabled. // run when **only** the browser feature is enabled.

View File

@@ -10,7 +10,7 @@ use crate::{
}; };
use std::{borrow::Cow, sync::Arc}; use std::{borrow::Cow, sync::Arc};
/// Adds a custom attribute with any key-value combintion. /// Adds a custom attribute with any key-value combination.
#[inline(always)] #[inline(always)]
pub fn custom_attribute<K, V>(key: K, value: V) -> CustomAttr<K, V> pub fn custom_attribute<K, V>(key: K, value: V) -> CustomAttr<K, V>
where where

View File

@@ -476,7 +476,7 @@ pub enum Position {
LastChild, LastChild,
} }
/// Declares that this type can be converted into some other type, which can be renderered. /// Declares that this type can be converted into some other type, which can be rendered.
pub trait IntoRender { pub trait IntoRender {
/// The renderable type into which this type can be converted. /// The renderable type into which this type can be converted.
type Output; type Output;