Skip to content

Commit

Permalink
Improve cleaners docs
Browse files Browse the repository at this point in the history
  • Loading branch information
frengor committed Jul 29, 2024
1 parent 481d213 commit 6acdf24
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cleaners/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
//!
//! # Avoiding memory leaks
//!
//! Usually, [`Cleaner`]s are stored inside a cycle-collected object. Make sure to **never capture** a reference to the containing object
//! Usually, [`Cleaner`]s are stored inside a cycle-collected object. Make sure to **never capture** a reference to the container object
//! inside the cleaning action closure, otherwise the object will be leaked and the cleaning action will never be executed.
//!
//! # Cleaners vs finalization
Expand Down Expand Up @@ -83,7 +83,7 @@ impl Cleaner {
///
/// # Avoiding memory leaks
/// Usually, [`Cleaner`]s are stored inside a cycle-collected object. Make sure to **never capture**
/// a reference to the containing object inside the `action` closure, otherwise the object will
/// a reference to the container object inside the `action` closure, otherwise the object will
/// be leaked and the cleaning action will never be executed.
#[inline]
pub fn register(&self, action: impl FnOnce() + 'static) -> Cleanable {
Expand Down

0 comments on commit 6acdf24

Please sign in to comment.