From 43ad236964c5daed4ba8ccef453e67b12ff3bdea Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Fri, 2 Aug 2024 14:02:41 +0700 Subject: [PATCH 1/3] Enable `clippy::doc_markdown` for non-masonry crates. --- Cargo.toml | 2 ++ masonry/src/lib.rs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 35b33f432..fbc70c079 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,6 +49,8 @@ rust.variant_size_differences = "warn" clippy.allow_attributes_without_reason = "warn" clippy.collection_is_never_read = "warn" clippy.debug_assert_with_mut_call = "warn" +# This is marked as `allow` within masonry due to #449. +clippy.doc_markdown = "warn" clippy.fn_to_numeric_cast_any = "forbid" clippy.infinite_loop = "warn" clippy.large_include_file = "warn" diff --git a/masonry/src/lib.rs b/masonry/src/lib.rs index 633bc4a1e..90f89a1e1 100644 --- a/masonry/src/lib.rs +++ b/masonry/src/lib.rs @@ -80,6 +80,8 @@ //! [Druid]: https://crates.io/crates/druid //! [Xilem]: https://crates.io/crates/xilem +// TODO: #449: Remove this once the issues within masonry are fixed. +#![allow(rustdoc::broken_intra_doc_links, clippy::doc_markdown)] #![deny(clippy::trivially_copy_pass_by_ref)] // #![deny(rustdoc::broken_intra_doc_links)] // #![warn(missing_docs)] From 5c474817df708f081b2584eb6dbea05f18626ef4 Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Fri, 2 Aug 2024 14:17:34 +0700 Subject: [PATCH 2/3] Fix a couple of remaining issues in xilem test/example targets. --- xilem/examples/calc.rs | 2 +- xilem_core/src/message.rs | 2 +- xilem_core/tests/one_of.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/xilem/examples/calc.rs b/xilem/examples/calc.rs index bf7d4aec1..4b3d8c7c7 100644 --- a/xilem/examples/calc.rs +++ b/xilem/examples/calc.rs @@ -287,7 +287,7 @@ fn expanded_button( } /// Returns an expanded button that triggers the calculator's operator handler, -/// on_entered_operator(). +/// `on_entered_operator()`. fn operator_button(math_operator: MathOperator) -> impl WidgetView { expanded_button(math_operator.as_str(), move |data: &mut Calculator| { data.on_entered_operator(math_operator); diff --git a/xilem_core/src/message.rs b/xilem_core/src/message.rs index 6ea793e78..d5322937c 100644 --- a/xilem_core/src/message.rs +++ b/xilem_core/src/message.rs @@ -155,7 +155,7 @@ mod tests { } #[test] - /// DynMessage's debug should pass through the debug implementation of + /// `DynMessage`'s debug should pass through the debug implementation of fn message_debug() { let message: DynMessage = Box::new(MyMessage("".to_string())); let debug_result = format!("{message:?}"); diff --git a/xilem_core/tests/one_of.rs b/xilem_core/tests/one_of.rs index 71f11e0e4..588b35a7e 100644 --- a/xilem_core/tests/one_of.rs +++ b/xilem_core/tests/one_of.rs @@ -205,7 +205,7 @@ fn one_of_type_change_rebuild() { } #[test] -/// OneOf2 should successfully allow the child to teardown +/// `OneOf2` should successfully allow the child to teardown fn one_of_passthrough_teardown() { let view1: OneOf2, OperationView<1>> = OneOf2::A(record_ops_0(0)); let mut ctx = TestCtx::default(); From 8952f70dc23b9be303d5659ff336166afb438d7b Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Fri, 2 Aug 2024 14:30:26 +0700 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: Daniel McNab <36049421+DJMcNab@users.noreply.github.com> --- Cargo.toml | 2 +- masonry/src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index fbc70c079..3bee915d1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,7 +49,7 @@ rust.variant_size_differences = "warn" clippy.allow_attributes_without_reason = "warn" clippy.collection_is_never_read = "warn" clippy.debug_assert_with_mut_call = "warn" -# This is marked as `allow` within masonry due to #449. +# This is marked as `allow` within masonry due to https://github.com/linebender/xilem/issues/449. clippy.doc_markdown = "warn" clippy.fn_to_numeric_cast_any = "forbid" clippy.infinite_loop = "warn" diff --git a/masonry/src/lib.rs b/masonry/src/lib.rs index 90f89a1e1..54198de17 100644 --- a/masonry/src/lib.rs +++ b/masonry/src/lib.rs @@ -80,7 +80,7 @@ //! [Druid]: https://crates.io/crates/druid //! [Xilem]: https://crates.io/crates/xilem -// TODO: #449: Remove this once the issues within masonry are fixed. +// TODO: Remove this once the issues within masonry are fixed. Tracked in https://github.com/linebender/xilem/issues/449 #![allow(rustdoc::broken_intra_doc_links, clippy::doc_markdown)] #![deny(clippy::trivially_copy_pass_by_ref)] // #![deny(rustdoc::broken_intra_doc_links)]