From 186182b0888e1f6391fb715d036dad847c230813 Mon Sep 17 00:00:00 2001 From: guoweikang Date: Wed, 16 Oct 2024 10:45:41 +0800 Subject: [PATCH] add doc for pub func Signed-off-by: guoweikang --- src/lib.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 8131093..a9b118c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -100,7 +100,7 @@ pub use raw_list::{GetLinks, Links}; #[macro_export] macro_rules! def_node { ($struct_name:ident, $type:ty) => { - #[doc = concat!("Struct ", stringify!($struct_name),"is a Node wrapper for type ", stringify!($type))] + #[doc = "A node wrapper for inner type "] pub struct $struct_name { inner: $type, links: $crate::Links, @@ -116,6 +116,7 @@ macro_rules! def_node { } impl $struct_name { + #[doc = "Create a node"] pub const fn new(inner: $type) -> Self { Self { inner, @@ -124,6 +125,7 @@ macro_rules! def_node { } #[inline] + #[doc = "Get inner"] pub fn inner(&self) -> &$type { &self.inner } @@ -144,7 +146,7 @@ macro_rules! def_node { #[macro_export] macro_rules! def_generic_node { ($struct_name:ident) => { - #[doc = concat!("Struct ", stringify!($struct_name),"is a Node wrapper include a generic type")] + #[doc = "A node wrapper include a generic type")] pub struct $struct_name { pub inner: T, links: $crate::Links, @@ -160,6 +162,7 @@ macro_rules! def_generic_node { } impl $struct_name { + #[doc = "Create a node"] pub const fn new(inner: T) -> Self { Self { inner, @@ -168,6 +171,7 @@ macro_rules! def_generic_node { } #[inline] + #[doc = "Get inner"] pub fn inner(&self) -> &T { &self.inner }