From 301fb9e2a3aae0aaad6191a604641cb74e46b96f Mon Sep 17 00:00:00 2001 From: Kevin Reid Date: Tue, 19 Dec 2023 09:25:45 -0800 Subject: [PATCH] Fix/suppress upcoming `clippy::doc_markdown` lint. In nightly the lint has been expanded to detect "foo()" as an item name. --- all-is-cubes-gpu/src/in_wgpu/space.rs | 2 +- all-is-cubes-port/src/gltf/buffer.rs | 2 +- all-is-cubes-server/src/bin/aic-server.rs | 2 +- all-is-cubes-wasm/src/gameapp.rs | 2 +- all-is-cubes/src/block/evaluated.rs | 1 + all-is-cubes/src/math/rotation.rs | 2 +- all-is-cubes/src/raycast.rs | 4 ++-- all-is-cubes/src/space/palette.rs | 2 +- all-is-cubes/src/space/tests.rs | 4 ++-- test-renderers/src/test_cases.rs | 4 ++-- 10 files changed, 13 insertions(+), 12 deletions(-) diff --git a/all-is-cubes-gpu/src/in_wgpu/space.rs b/all-is-cubes-gpu/src/in_wgpu/space.rs index 0310f15f2..8f2b2e5e5 100644 --- a/all-is-cubes-gpu/src/in_wgpu/space.rs +++ b/all-is-cubes-gpu/src/in_wgpu/space.rs @@ -540,7 +540,7 @@ impl SpaceRenderer { } /// Generate debug lines for the current state of the renderer, assuming - /// draw() was just called. + /// `draw()` was just called. pub(crate) fn debug_lines(&self, camera: &Camera, v: &mut Vec) { let Some(csm) = &self.csm else { return; diff --git a/all-is-cubes-port/src/gltf/buffer.rs b/all-is-cubes-port/src/gltf/buffer.rs index a03f07d95..164654ddd 100644 --- a/all-is-cubes-port/src/gltf/buffer.rs +++ b/all-is-cubes-port/src/gltf/buffer.rs @@ -187,7 +187,7 @@ impl PartialEq for GltfDataDestination { /// an in-memory buffer to a file based on the length, and in any case /// remembers the length written and encodes the final URI of the data. /// -/// Does not guarantee the length is correct if write() is called after +/// Does not guarantee the length is correct if `write()` is called after /// an IO error was previously returned. #[derive(Debug)] enum SwitchingWriter { diff --git a/all-is-cubes-server/src/bin/aic-server.rs b/all-is-cubes-server/src/bin/aic-server.rs index 9d7d5dc8e..21ad3bb81 100644 --- a/all-is-cubes-server/src/bin/aic-server.rs +++ b/all-is-cubes-server/src/bin/aic-server.rs @@ -1,4 +1,4 @@ -//! main() for a server that serves the All is Cubes client as well as being a game +//! `main()` for a server that serves the All is Cubes client as well as being a game //! server. // Crate-specific lint settings. (General settings can be found in the workspace manifest.) diff --git a/all-is-cubes-wasm/src/gameapp.rs b/all-is-cubes-wasm/src/gameapp.rs index ab7248b12..f54fb5219 100644 --- a/all-is-cubes-wasm/src/gameapp.rs +++ b/all-is-cubes-wasm/src/gameapp.rs @@ -106,7 +106,7 @@ impl WebSession { self_rc } - /// This method is broken out of new() so we can just use `self`. Well, some of the time. + /// This method is broken out of `new()` so we can just use `self`. Well, some of the time. /// TODO: reconsider fn init_dom(self: Rc) { self.add_canvas_to_self_event_listener( diff --git a/all-is-cubes/src/block/evaluated.rs b/all-is-cubes/src/block/evaluated.rs index ddadad3ed..4188d059b 100644 --- a/all-is-cubes/src/block/evaluated.rs +++ b/all-is-cubes/src/block/evaluated.rs @@ -712,6 +712,7 @@ impl<'a> arbitrary::Arbitrary<'a> for Evoxels { } } +#[allow(clippy::doc_markdown)] // https://github.com/rust-lang/rust-clippy/issues/9473 /// The result of [AIR].[evaluate()](Block::evaluate), as a constant. /// This may be used when an [`EvaluatedBlock`] value is needed but there is no block /// value. diff --git a/all-is-cubes/src/math/rotation.rs b/all-is-cubes/src/math/rotation.rs index afc5852b5..39012b48e 100644 --- a/all-is-cubes/src/math/rotation.rs +++ b/all-is-cubes/src/math/rotation.rs @@ -583,7 +583,7 @@ mod tests { } } - /// We can compute the inverse via iterate(). + /// We can compute the inverse via `iterate()`. /// This test also serves to regenerate the inverse table. #[test] fn inverse_from_iterate() { diff --git a/all-is-cubes/src/raycast.rs b/all-is-cubes/src/raycast.rs index 2fb27f344..d8b820d7a 100644 --- a/all-is-cubes/src/raycast.rs +++ b/all-is-cubes/src/raycast.rs @@ -1058,7 +1058,7 @@ mod tests { } /// Regression test (found by fuzzing) for being outside of integer - /// range while also using within(). + /// range while also using `within()`. #[test] fn start_outside_of_integer_range_with_bounds() { let bounds = GridAab::from_lower_size([0, 0, 0], [10, 10, 10]); @@ -1146,7 +1146,7 @@ mod tests { ); } - /// within() wasn't working for axis-aligned rays that don't intersect the world, + /// `within()` wasn't working for axis-aligned rays that don't intersect the world, /// which should produce zero steps. #[test] fn regression_test_2() { diff --git a/all-is-cubes/src/space/palette.rs b/all-is-cubes/src/space/palette.rs index 13e179289..a0f8879f4 100644 --- a/all-is-cubes/src/space/palette.rs +++ b/all-is-cubes/src/space/palette.rs @@ -374,7 +374,7 @@ impl crate::universe::VisitRefs for Palette { impl Clone for Palette { /// Cloning a [`Palette`] produces a copy which is independently mutable and /// independently tracks block changes, but initially has the same state. It will - /// reevaluate on the next step(). + /// reevaluate on the next `step()`. fn clone(&self) -> Self { // Construct the new set with a full todo so that it establishes listeners. // This will unfortunately also cause a reevaluation, but avoiding that would diff --git a/all-is-cubes/src/space/tests.rs b/all-is-cubes/src/space/tests.rs index 734635c12..d0c80bfe9 100644 --- a/all-is-cubes/src/space/tests.rs +++ b/all-is-cubes/src/space/tests.rs @@ -45,7 +45,7 @@ fn initial_state_consistency() { .consistency_check(); } -/// set() returns Ok when the cube was changed or already equal. +/// `set()` returns Ok when the cube was changed or already equal. #[test] fn set_success() { let [first, second] = make_some_blocks(); @@ -61,7 +61,7 @@ fn set_success() { space.consistency_check(); // bonus testing } -/// Test set() with a block that fails evaluation. +/// Test `set()` with a block that fails evaluation. /// This should succeed but leave a placeholder. /// /// This test case should also cover `RefError::InUse` and other evaluation errors. diff --git a/test-renderers/src/test_cases.rs b/test-renderers/src/test_cases.rs index 7ae766601..622b18368 100644 --- a/test-renderers/src/test_cases.rs +++ b/test-renderers/src/test_cases.rs @@ -694,9 +694,9 @@ async fn light(mut context: RenderTestContext, option: LightingOption) { .await; } -/// Test calling renderer's draw() without update(). +/// Test calling renderer's `draw()` without `update()`. /// This is not directly useful/plausible by itself, but is intended to -/// exercise robustness in the presence of errors that stop update() from +/// exercise robustness in the presence of errors that stop `update()` from /// completing. async fn no_update(mut context: RenderTestContext) { let mut universe = Universe::new();