From 8c9693bc43923626b0998786093b29a94d513f97 Mon Sep 17 00:00:00 2001 From: Ben Reeves Date: Thu, 3 Oct 2024 00:31:15 -0500 Subject: [PATCH] Specify how to create a `Registration` in its doc comment. As a brand new reader of the mnemos kernel docs, this was a bit difficult to discover. I started at `Registry::register`, and saw that it requires a `Registration`. But `Registration` has no constructor, and its docs didn't mention how one is created. --- source/kernel/src/registry/listener.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/kernel/src/registry/listener.rs b/source/kernel/src/registry/listener.rs index 0db220e6..c4f9901c 100644 --- a/source/kernel/src/registry/listener.rs +++ b/source/kernel/src/registry/listener.rs @@ -17,6 +17,8 @@ pub struct Listener { /// A registration for a [`RegisteredDriver`]. This type is provided to /// [`Registry::register`] in order to add the driver to the registry. /// +/// Call [`Listener::new`] to get a `Listener`/`Registration` pair. +/// /// [`Registry::register`]: crate::registry::Registry::register #[must_use = "a `Registration` does nothing if not registered with a `Registry`"] pub struct Registration {