chore: fix some comments (#13083)

# Objective

remove repetitive words

Signed-off-by: findmyhappy <findhappy@sohu.com>
This commit is contained in:
findmyhappy 2024-04-26 03:09:16 +08:00 committed by GitHub
parent 414abb4959
commit 36a3e53e10
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 7 additions and 6 deletions

View file

@ -41,7 +41,7 @@ impl<'w, 's, D: QueryData, F: QueryFilter> QueryParIter<'w, 's, D, F> {
/// Runs `func` on each query result in parallel on a value returned by `init`. /// Runs `func` on each query result in parallel on a value returned by `init`.
/// ///
/// `init` may be called multiple times per thread, and the values returned may be discarded between tasks on any given thread. /// `init` may be called multiple times per thread, and the values returned may be discarded between tasks on any given thread.
/// Callers should avoid using this function as if it were a a parallel version /// Callers should avoid using this function as if it were a parallel version
/// of [`Iterator::fold`]. /// of [`Iterator::fold`].
/// ///
/// # Example /// # Example

View file

@ -1320,7 +1320,7 @@ pub(crate) fn assign_lights_to_clusters(
// scale x and y cluster count to be able to fit all our indices // scale x and y cluster count to be able to fit all our indices
// we take the ratio of the actual indices over the index estimate. // we take the ratio of the actual indices over the index estimate.
// this not not guaranteed to be small enough due to overlapped tiles, but // this is not guaranteed to be small enough due to overlapped tiles, but
// the conservative estimate is more than sufficient to cover the // the conservative estimate is more than sufficient to cover the
// difference // difference
let index_ratio = ViewClusterBindings::MAX_INDICES as f32 / cluster_index_estimate; let index_ratio = ViewClusterBindings::MAX_INDICES as f32 / cluster_index_estimate;

View file

@ -68,7 +68,7 @@ of type `T`. If you've ever worked with C++, `NonNull<T>` is very close to a C++
untyped memory address. Pointing at the unit type (or some other zero-sized type) just happens to be the convention. The only way to reasonably use them is to untyped memory address. Pointing at the unit type (or some other zero-sized type) just happens to be the convention. The only way to reasonably use them is to
cast back to a typed pointer. They show up occasionally when dealing with FFI and the rare occasion where dynamic dispatch is required, but a trait is too cast back to a typed pointer. They show up occasionally when dealing with FFI and the rare occasion where dynamic dispatch is required, but a trait is too
constraining of an interface to work with. A great example of this are the [RawWaker] APIs, where a singular trait (or set of traits) may be insufficient to capture constraining of an interface to work with. A great example of this are the [RawWaker] APIs, where a singular trait (or set of traits) may be insufficient to capture
all usage patterns. `*mut ()` should only be used to carry the mutability of the target, and as there is no way to to mutate an unknown type. all usage patterns. `*mut ()` should only be used to carry the mutability of the target, and as there is no way to mutate an unknown type.
[RawWaker]: https://doc.rust-lang.org/std/task/struct.RawWaker.html [RawWaker]: https://doc.rust-lang.org/std/task/struct.RawWaker.html

View file

@ -129,7 +129,7 @@ fn draw(in: VertexOutput) -> vec4<f32> {
// Signed distances. The magnitude is the distance of the point from the edge of the shape. // Signed distances. The magnitude is the distance of the point from the edge of the shape.
// * Negative values indicate that the point is inside the shape. // * Negative values indicate that the point is inside the shape.
// * Zero values indicate the point is on on the edge of the shape. // * Zero values indicate the point is on the edge of the shape.
// * Positive values indicate the point is outside the shape. // * Positive values indicate the point is outside the shape.
// Signed distance from the exterior boundary. // Signed distance from the exterior boundary.

View file

@ -69,8 +69,9 @@ fn log_once_system() {
info_once!("logs once per call site, so this works just fine: {}", i); info_once!("logs once per call site, so this works just fine: {}", i);
} }
// you can also use the 'once!' macro directly, in situations you want do do // you can also use the `once!` macro directly,
// something expensive only once within the context of a continuous system. // in situations where you want to do something expensive only once
// within the context of a continuous system.
once!({ once!({
info!("doing expensive things"); info!("doing expensive things");
let mut a: u64 = 0; let mut a: u64 = 0;