docs: fix grammar and typos in comments and documentation (#5254)

* docs: fix grammar and typos in comments and documentation

* docs: use British English style for e.g. and i.e. (no trailing comma)
Changed from American English style (e.g.,) to British English style (e.g.)
for consistency with the rest of the codebase."
This commit is contained in:
Antti Jalomäki authored and GitHub committed 2026-01-23 13:30:00 -08:00
1 parent 409d8358b6
commit 4070d0c8bd
19 files changed
+30 -30

No files matched your search

+1 -1
View File
@@ -23,7 +23,7 @@ corresponds to the feature in their cargo.toml. So,
- `dx serve --desktop` will enable the `desktop` feature
In this case, we set default-features to false and then add back the default features that
aren't renderers, and then add the feature for the given renderer (ie web/desktop/mobile).
aren't renderers, and then add the feature for the given renderer (i.e., web/desktop/mobile).
We call this "no-default-features-stripped."
There are a few cases where the user doesn't need to pass a platform.
+1 -1
View File
@@ -1195,7 +1195,7 @@ impl BuildRequest {
//
// { "artifact":"target/debug/deps/libdioxus_core-4f2a0b3c1e5f8b7c.rlib", "emit":"link" }
//
// There are other outputs like depinfo that we might be interested in in the future.
// There are other outputs like depinfo that we might be interested in the future.
if let Ok(artifact) = serde_json::from_str::<RustcArtifact>(&line) {
if artifact.emit == "link" {
output_location = Some(artifact.artifact);
+2 -2
View File
@@ -333,11 +333,11 @@ impl ComponentCommand {
/// If both values are None, the default registry will be used
#[derive(Clone, Debug, Parser, Default, Serialize, Deserialize)]
pub struct RemoteComponentRegistry {
/// The url of the the component registry
/// The url of the component registry
#[arg(long)]
git: Option<String>,
/// The revision of the the component registry
/// The revision of the component registry
#[arg(long)]
rev: Option<String>,
}
+2 -2
View File
@@ -663,7 +663,7 @@ impl TraceController {
}
}
// If we have "safe" error, we we need to log it
// If we have "safe" error, we need to log it
if let Ok(Err(err)) = &res {
self.record_backtrace(
err,
@@ -1081,7 +1081,7 @@ where
};
// If the event has the captured panic attached, we record it through capture_backtrace directly.
// Otherwise, we wont have a backtrace to work with, so we just log the event as a telemetry event.
// Otherwise, we won't have a backtrace to work with, so we just log the event as a telemetry event.
if let Some(error) = visitor.captured_panic {
self.record_backtrace(
error.error.as_ref(),
+1 -1
View File
@@ -292,7 +292,7 @@ impl Output {
});
}
// Toggle the more modal by swapping the the terminal with a new one
// Toggle the more modal by swapping the terminal with a new one
// This is a bit of a hack since crossterm doesn't technically support changing the
// size of an inline viewport.
KeyCode::Char('/') => {
+1 -1
View File
@@ -46,7 +46,7 @@ pub(crate) struct AppServer {
pub(crate) client: AppBuilder,
pub(crate) server: Option<AppBuilder>,
// Related to to the filesystem watcher
// Related to the filesystem watcher
pub(crate) watcher: Box<dyn notify::Watcher>,
pub(crate) _watcher_tx: UnboundedSender<notify::Event>,
pub(crate) watcher_rx: UnboundedReceiver<notify::Event>,
+1 -1
View File
@@ -222,7 +222,7 @@ impl TailwindCli {
let arch = match target_lexicon::HOST.architecture {
target_lexicon::Architecture::X86_64 if platform == "windows" => "x64.exe",
target_lexicon::Architecture::X86_64 => "x64",
// you would think this would be arm64.exe, but tailwind doesnt distribute arm64 binaries
// you would think this would be arm64.exe, but tailwind doesn't distribute arm64 binaries
target_lexicon::Architecture::Aarch64(_) if platform == "windows" => "x64.exe",
target_lexicon::Architecture::Aarch64(_) => "arm64",
_ => return None,
+1 -1
View File
@@ -6,7 +6,7 @@ use crate::ConstReadBuffer;
const DEFAULT_MAX_SIZE: usize = 2usize.pow(10);
/// [`ConstVec`] is a version of [`Vec`] that is usable in const contexts. It has
/// a fixed maximum size, but it can can grow and shrink within that size limit
/// a fixed maximum size, but it can grow and shrink within that size limit
/// as needed.
///
/// # Example
+1 -1
View File
@@ -80,7 +80,7 @@ enum KnownPlatform {
Other(LaunchFn),
}
#[allow(clippy::redundant_closure)] // clippy doesnt doesn't understand our coercion to fn
#[allow(clippy::redundant_closure)] // clippy doesn't understand our coercion to fn
impl LaunchBuilder {
/// Create a new builder for your application. This will create a launch configuration for the current platform based on the features enabled on the `dioxus` crate.
// If you aren't using a third party renderer and this is not a docs.rs build, generate a warning about no renderer being enabled
+1 -1
View File
@@ -44,7 +44,7 @@ fn app() -> Element {
// You can pass initial data to the eval function by formatting it into the JavaScript code.
const LOOP_COUNT: usize = 10;
let eval = document::eval(&format!(r#"for(let i = 0; i < {LOOP_COUNT}; i++) {{
// You can receive values asynchronously with the the `await dioxus.recv()` method.
// You can receive values asynchronously with the `await dioxus.recv()` method.
let value = await dioxus.recv();
console.log("Received", value);
}}"#));
+1 -1
View File
@@ -113,7 +113,7 @@ impl ServerFunction {
response.headers_mut().extend(headers);
}
// it it accepts text/html (i.e., is a plain form post) and doesn't already have a
// if it accepts text/html (i.e., is a plain form post) and doesn't already have a
// Location set, then redirect to Referer
if accepts_html {
if let Some(referrer) = referrer {
+1 -1
View File
@@ -89,7 +89,7 @@ pub type ChunkedTextStream = Streaming<String, CborEncoding>;
/// ## Browser Support for Streaming Input
///
/// Browser fetch requests do not currently support full request duplexing, which
/// means that that they do not begin handling responses until the full request has been sent.
/// means that they do not begin handling responses until the full request has been sent.
///
/// This means that if you use a streaming input encoding, the input stream needs to
/// end before the output will begin.
+2 -2
View File
@@ -40,12 +40,12 @@ pub mod minimal_bindings {
#[wasm_bindgen(module = "/src/js/hydrate.js")]
extern "C" {
/// Register a callback that that will be called to hydrate a node at the given id with data from the server
/// Register a callback that will be called to hydrate a node at the given id with data from the server
pub fn register_rehydrate_chunk_for_streaming(
closure: &wasm_bindgen::closure::Closure<dyn FnMut(Vec<u32>, js_sys::Uint8Array)>,
);
/// Register a callback that that will be called to hydrate a node at the given id with data from the server
/// Register a callback that will be called to hydrate a node at the given id with data from the server
pub fn register_rehydrate_chunk_for_streaming_debug(
closure: &wasm_bindgen::closure::Closure<
dyn FnMut(Vec<u32>, js_sys::Uint8Array, Option<Vec<String>>, Option<Vec<String>>),
+2 -2
View File
@@ -48,11 +48,11 @@
//! - Hot reloading `Component { "hello" }`:
//! - Try to hot reload the component body `"hello"` with the dynamic pool from `"{text}"`: Success with 1 unused dynamic item
//! - Try to hot reload the component body `"hello"` with the dynamic pool from `"hello"`: Success with 0 unused dynamic items
//! - We use the the template that leaves the least unused dynamic items in the pool - `"hello"`
//! - We use the template that leaves the least unused dynamic items in the pool - `"hello"`
//! - Hot reloading `Component { "{text}" }`:
//! - Try to hot reload the component body `"{text}"` with the dynamic pool from `"{text}"`: Success with 0 unused dynamic items
//! - The `"hello"` template has already been hot reloaded, so we don't try to hot reload it again
//! - We use the the template that leaves the least unused dynamic items in the pool - `"{text}"`
//! - We use the template that leaves the least unused dynamic items in the pool - `"{text}"`
//!
//! Greedy algorithms are optimal when:
//! - The step we take reduces the problem size
+1 -1
View File
@@ -17,7 +17,7 @@ use dioxus_signals::{
/// - A tree of subscriptions used to make the store reactive.
///
/// The `SelectorScope` contains a view into the lock (`Lens`) and a path into the subscription tree. When
/// the selector is read to, it will track the current path in the subscription tree. When it it written to
/// the selector is read to, it will track the current path in the subscription tree. When it is written to
/// it marks itself and all its children as dirty.
///
/// When you derive the [`Store`](dioxus_stores_macro::Store) macro on your data structure,
+2 -2
View File
@@ -132,7 +132,7 @@
//!
//! ```rust
//! fn main() {
//! // Changes to the the `for` loop will cause an unwind to this call.
//! // Changes to the `for` loop will cause an unwind to this call.
//! subsecond::call(|| {
//! for x in 0..5 {
//! // Changes to the `println!` will be isolated to this call.
@@ -271,7 +271,7 @@ pub fn call<O>(mut f: impl FnMut() -> O) -> O {
}
// We use an AtomicPtr with a leaked JumpTable and Relaxed ordering to give us a global jump table
// with very very little overhead. Reading this amounts of a Relaxed atomic load which basically
// with very little overhead. Reading this amounts of a Relaxed atomic load which basically
// is no overhead. We might want to look into using a thread_local with a stop-the-world approach
// just in case multiple threads try to call the jump table before synchronization with the runtime.
// For Dioxus purposes, this is not a big deal, but for libraries like bevy which heavily rely on