Skip to content

Commit

Permalink
Clean up code.
Browse files Browse the repository at this point in the history
  • Loading branch information
reitermarkus committed Sep 17, 2022
1 parent 5bd58af commit 87c10a5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
2 changes: 0 additions & 2 deletions src/imp_cs.rs
Expand Up @@ -47,8 +47,6 @@ impl<T> OnceCell<T> {
let cell = self.value.borrow(cs);
cell.get_or_try_init(f).map(|_| {
self.initialized.store(true, Ordering::Release);

()
})
})
}
Expand Down
13 changes: 4 additions & 9 deletions src/lib.rs
Expand Up @@ -329,11 +329,6 @@

#![cfg_attr(not(feature = "std"), no_std)]

#[cfg(not(feature = "std"))]
use core as lib;
#[cfg(feature = "std")]
use std as lib;

#[cfg(feature = "alloc")]
extern crate alloc;

Expand All @@ -351,12 +346,13 @@ mod imp;

/// Single-threaded version of `OnceCell`.
pub mod unsync {
use super::lib::{
use core::{
cell::{Cell, UnsafeCell},
fmt, mem,
ops::{Deref, DerefMut},
panic::{RefUnwindSafe, UnwindSafe},
};

use super::unwrap_unchecked;

/// A cell which can be written to only once. It is not thread safe.
Expand Down Expand Up @@ -836,15 +832,14 @@ pub mod unsync {
/// Thread-safe, blocking version of `OnceCell`.
#[cfg(feature = "sync")]
pub mod sync {
use super::lib::{
use core::{
cell::Cell,
fmt, mem,
ops::{Deref, DerefMut},
panic::RefUnwindSafe,
};

use super::imp::OnceCell as Imp;
use super::take_unchecked;
use super::{imp::OnceCell as Imp, take_unchecked};

/// A thread-safe cell which can be written to only once.
///
Expand Down

0 comments on commit 87c10a5

Please sign in to comment.