Skip to content

Commit d46ea57

Browse files
committed
refactor: Rename LENT to LENT_POINTERS
1 parent 2105750 commit d46ea57

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ pub mod error;
3636

3737
#[cfg(all(feature = "std", feature = "lender"))]
3838
lazy_static! {
39-
static ref LENT: RwLock<HashSet<usize>> = RwLock::new(HashSet::new());
39+
static ref LENT_POINTERS: RwLock<HashSet<usize>> = RwLock::new(HashSet::new());
4040
}
4141

4242
#[cfg(all(feature = "std", feature = "lender"))]
4343
#[inline]
4444
fn invalid_error_check<T>(pointer: *const T) -> Result<(), crate::error::PointerError> {
45-
if !LENT.read().unwrap().contains(&(pointer as usize)) {
45+
if !LENT_POINTERS.read().unwrap().contains(&(pointer as usize)) {
4646
return Err(crate::error::PointerError::Invalid);
4747
}
4848
return Ok(());
@@ -65,7 +65,7 @@ fn null_error_check<T>(pointer: *const T) -> Result<(), crate::error::PointerErr
6565
pub fn raw<T>(data: T) -> *mut T {
6666
let pointer = Box::into_raw(Box::new(data));
6767
#[cfg(all(feature = "std", feature = "lender"))]
68-
LENT.write().unwrap().insert(pointer as usize);
68+
LENT_POINTERS.write().unwrap().insert(pointer as usize);
6969
return pointer;
7070
}
7171

@@ -107,7 +107,7 @@ pub unsafe fn own_back<T>(pointer: *mut T) -> Result<T, crate::error::PointerErr
107107
invalid_error_check(pointer)?;
108108
let boxed = { Box::from_raw(pointer) };
109109
#[cfg(all(feature = "std", feature = "lender"))]
110-
LENT.write().unwrap().remove(&(pointer as usize));
110+
LENT_POINTERS.write().unwrap().remove(&(pointer as usize));
111111
return Ok(*boxed);
112112
}
113113

0 commit comments

Comments
 (0)