From 6c91f5f85b391f1bcecdaf1018ef2dad2b98abb8 Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Fri, 2 Aug 2024 06:24:06 +0700 Subject: [PATCH] Fix doc warnings in xilem_core, xilem_web --- .clippy.toml | 2 ++ xilem_core/src/sequence.rs | 4 ++-- xilem_core/src/views/one_of.rs | 4 ++-- xilem_core/src/views/run_once.rs | 2 +- xilem_web/src/events.rs | 4 ++-- xilem_web/src/interfaces.rs | 4 ++-- xilem_web/src/lib.rs | 2 +- xilem_web/src/pointer.rs | 2 +- xilem_web/src/vecmap.rs | 2 +- xilem_web/web_examples/todomvc/src/state.rs | 4 ++-- 10 files changed, 16 insertions(+), 14 deletions(-) create mode 100644 .clippy.toml diff --git a/.clippy.toml b/.clippy.toml new file mode 100644 index 000000000..5c5a9538f --- /dev/null +++ b/.clippy.toml @@ -0,0 +1,2 @@ +# Don't warn about these identifiers when using clippy::doc_markdown. +doc-valid-idents = ["MathML", ".."] diff --git a/xilem_core/src/sequence.rs b/xilem_core/src/sequence.rs index 1f64f6d61..ebabb0b3f 100644 --- a/xilem_core/src/sequence.rs +++ b/xilem_core/src/sequence.rs @@ -338,8 +338,8 @@ where } } -/// A `View` with [no element](crate::NoElement) can be added to any ViewSequence, because it does not use any -/// properties of the Element type. +/// A `View` with [no element](crate::NoElement) can be added to any [`ViewSequence`], because it does not use any +/// properties of the `Element` type. impl ViewSequence for NoElementView where diff --git a/xilem_core/src/views/one_of.rs b/xilem_core/src/views/one_of.rs index 67bf82cef..de7b71616 100644 --- a/xilem_core/src/views/one_of.rs +++ b/xilem_core/src/views/one_of.rs @@ -569,10 +569,10 @@ mod hidden { pub struct OneOfState { /// The current state of the inner view or view sequence. pub(super) inner_state: super::OneOf, - /// The generation this OneOfN is at. + /// The generation this `OneOfN` is at. /// /// If the variant of `OneOfN` has changed, i.e. the type of the inner view, - /// the generation is incremented and used as ViewId in the id_path, + /// the generation is incremented and used as `ViewId` in the `id_path`, /// to avoid (possibly async) messages reaching the wrong view, /// See the implementations of other `ViewSequence`s for more details pub(super) generation: u64, diff --git a/xilem_core/src/views/run_once.rs b/xilem_core/src/views/run_once.rs index 9ab7dcf1d..f8fed9510 100644 --- a/xilem_core/src/views/run_once.rs +++ b/xilem_core/src/views/run_once.rs @@ -29,7 +29,7 @@ use crate::{MessageResult, NoElement, View, ViewPathTracker}; /// You might otherwise expect the function to be reran when the captured values change, which is not the case. /// [`run_once_raw`] is the same as `run_once`, but without this restriction. /// -/// // https://doc.rust-lang.org/error_codes/E0080.html +/// // /// // Note that this error code is only checked on nightly /// ```compile_fail,E0080 /// # use xilem_core::{run_once, View, docs::{Fake as ViewCtx}, PhantomView}; diff --git a/xilem_web/src/events.rs b/xilem_web/src/events.rs index 3211f4036..8b05f69e3 100644 --- a/xilem_web/src/events.rs +++ b/xilem_web/src/events.rs @@ -47,7 +47,7 @@ where self } - /// Whether the event handler should capture the event *before* being dispatched to any EventTarget beneath it in the DOM tree. (default = `false`) + /// Whether the event handler should capture the event *before* being dispatched to any `EventTarget` beneath it in the DOM tree. (default = `false`) /// /// Events that are bubbling upward through the tree will not trigger a listener designated to use capture. /// Event bubbling and capturing are two ways of propagating events that occur in an element that is nested within another element, @@ -348,7 +348,7 @@ macro_rules! event_definitions { self } - /// Whether the event handler should capture the event *before* being dispatched to any EventTarget beneath it in the DOM tree. (default = `false`) + /// Whether the event handler should capture the event *before* being dispatched to any `EventTarget` beneath it in the DOM tree. (default = `false`) /// /// Events that are bubbling upward through the tree will not trigger a listener designated to use capture. /// Event bubbling and capturing are two ways of propagating events that occur in an element that is nested within another element, diff --git a/xilem_web/src/interfaces.rs b/xilem_web/src/interfaces.rs index e585b2f4a..686119a94 100644 --- a/xilem_web/src/interfaces.rs +++ b/xilem_web/src/interfaces.rs @@ -896,7 +896,7 @@ where pub trait HtmlOptionElement: HtmlElement> { - /// A string representing the value of the HTMLOptionElement, i.e. the value attribute of the equivalent `