Skip to content

Commit

Permalink
Remove dead code
Browse files Browse the repository at this point in the history
```
error: method `with` is never used
  --> src/sync.rs:65:12
   |
62 |     pub(crate) trait UnsafeCellExt {
   |                      ------------- method in this trait
...
65 |         fn with<R, F>(&self, f: F) -> R
   |            ^^^^
   |
   = note: `-D dead-code` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(dead_code)]`
```
  • Loading branch information
taiki-e committed Mar 5, 2024
1 parent 93ee058 commit d494533
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions src/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ pub(crate) mod prelude {
pub(crate) trait UnsafeCellExt {
type Value;

fn with<R, F>(&self, f: F) -> R
where
F: FnOnce(*const Self::Value) -> R;

fn with_mut<R, F>(&self, f: F) -> R
where
F: FnOnce(*mut Self::Value) -> R;
Expand All @@ -74,13 +70,6 @@ pub(crate) mod prelude {
impl<T> UnsafeCellExt for cell::UnsafeCell<T> {
type Value = T;

fn with<R, F>(&self, f: F) -> R
where
F: FnOnce(*const Self::Value) -> R,
{
f(self.get())
}

fn with_mut<R, F>(&self, f: F) -> R
where
F: FnOnce(*mut Self::Value) -> R,
Expand Down

0 comments on commit d494533

Please sign in to comment.