Skip to content

Commit 0d08862

Browse files
committed
doc: Simplify reference documentation
1 parent 97fa950 commit 0d08862

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/lib.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -118,18 +118,15 @@ pub unsafe fn own_back<T>(pointer: *mut T) -> Result<T, crate::error::PointerErr
118118
return Ok(*boxed);
119119
}
120120

121-
/// Reference to a object but without back to own it.
122-
///
123-
/// That's the difference with [`own_back<T>()`], you must
124-
/// use [`own_back<T>()`] to own it again and it will be dropped.
121+
/// Reference to a object but without to own it.
125122
///
126123
/// # Errors
127124
///
128125
/// The pointer must be not null as it is an obvious invalid pointer.
129126
///
130127
/// # Safety
131128
///
132-
/// Invalid pointer or call it twice could cause an undefined behavior or heap error and a crash.
129+
/// Invalid pointer could cause an undefined behavior or heap error and a crash.
133130
#[inline]
134131
pub unsafe fn object<'a, T>(pointer: *const T) -> Result<&'a T, crate::error::PointerError> {
135132
null_error_check(pointer)?;
@@ -140,16 +137,13 @@ pub unsafe fn object<'a, T>(pointer: *const T) -> Result<&'a T, crate::error::Po
140137

141138
/// Mutable reference to a object but without back to own it.
142139
///
143-
/// That's the difference with [`own_back<T>()`], you must
144-
/// use [`own_back<T>()`] to own it again and it will be dropped.
145-
///
146140
/// # Errors
147141
///
148142
/// The pointer must be not null as it is an obvious invalid pointer.
149143
///
150144
/// # Safety
151145
///
152-
/// Invalid pointer or call it twice could cause an undefined behavior or heap error and a crash.
146+
/// Invalid pointer could cause an undefined behavior or heap error and a crash.
153147
#[inline]
154148
pub unsafe fn mut_object<'a, T>(pointer: *mut T) -> Result<&'a mut T, crate::error::PointerError> {
155149
null_error_check(pointer)?;

0 commit comments

Comments
 (0)