diff --git a/cmd/zfs_object_agent/util/src/lazy_static_ptr.rs b/cmd/zfs_object_agent/util/src/lazy_static_ptr.rs index 15d28156a8cc..d59c345e236b 100644 --- a/cmd/zfs_object_agent/util/src/lazy_static_ptr.rs +++ b/cmd/zfs_object_agent/util/src/lazy_static_ptr.rs @@ -18,13 +18,13 @@ pub use paste::paste; /// /// For example: /// ``` -/// lazy_static_ptr! { -/// pub static ref STRINGS: Mutex> = Default::default(); +/// util::lazy_static_ptr! { +/// pub static ref STRINGS: std::sync::Mutex> = Default::default(); /// } /// ``` /// This will declare a `pub static` variable named `STRINGS` which will deref to a /// `Box>>`, similar to lazy_static!. Additionally, it will declare -/// ``` +/// ```ignore /// static STRINGS_PTR: AtomicPtr>> = ...; /// ``` /// When `STRINGS` is initialized (on first dereference, or the .initialize() method), @@ -127,14 +127,13 @@ impl Drop for DebugPointerGuard { /// we are storing (but not dereferencing) a pointer to it. Typical use is combined with /// `lazy_static_ptr!`: /// ``` -/// fn func(thing: Thing) { -/// lazy_static_ptr! { -/// static ref THINGS: DebugPointerSet = Default::default(); -/// } -/// let mut thing = THINGS.insert(thing); -/// // use `thing` as usual, it deref's to the passed in Thing -/// thing.method(); +/// use util::lazy_static_ptr::DebugPointerSet; +/// util::lazy_static_ptr! { +/// static ref THINGS: DebugPointerSet> = Default::default(); /// } +/// let mut thing = THINGS.insert(Default::default()); +/// // use `thing` as usual, it deref's to the passed in Thing +/// thing.push(42); /// ``` /// Note that `lazy_static_ptr!` doesn't work well inside `async` /// functions/methods/closures, because it's hard to name the variable in the diff --git a/cmd/zfs_object_agent/util/src/vec_ext.rs b/cmd/zfs_object_agent/util/src/vec_ext.rs index 5bb945f23c47..d13f16af5138 100644 --- a/cmd/zfs_object_agent/util/src/vec_ext.rs +++ b/cmd/zfs_object_agent/util/src/vec_ext.rs @@ -12,7 +12,7 @@ use more_asserts::*; /// #[derivative(Debug)] /// struct Foo { /// #[derivative(Debug(format_with = "util::tersevec"))] -/// member: Vec +/// member: Vec /// } /// ``` pub fn tersevec(vec: &[E], fmt: &mut Formatter) -> Result {