Skip to content

Commit

Permalink
set msrv to 1.63
Browse files Browse the repository at this point in the history
  • Loading branch information
eagr committed Dec 22, 2023
1 parent 6eeec89 commit 6a6487f
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 80 deletions.
1 change: 1 addition & 0 deletions latches/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ repository = "https://github.com/mirromutth/latches"
license = "MIT OR Apache-2.0"
readme = "../README.md"
description = "A downward counter (CountDownLatch) which can be used to synchronize threads or coordinate tasks"
rust-version = "1.63" # keep in sync with docs

[package.metadata.docs.rs]
all-features = true
Expand Down
43 changes: 0 additions & 43 deletions latches/build.rs

This file was deleted.

14 changes: 0 additions & 14 deletions latches/src/lock/stds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,11 @@ pub(crate) struct EmptyCondvar(Mutex<()>, StdCondvar);
pub(crate) type CondvarGuard<'a> = MutexGuard<'a, ()>;

impl<T> Mutex<T> {
#[cfg(not(latches_no_const_sync))]
#[must_use]
#[inline]
pub(crate) const fn new(t: T) -> Self {
Self(StdMutex::new(t))
}
#[cfg(latches_no_const_sync)]
#[must_use]
#[inline]
pub(crate) fn new(t: T) -> Self {
Self(StdMutex::new(t))
}

pub(crate) fn lock(&self) -> MutexGuard<'_, T> {
match self.0.lock() {
Expand All @@ -38,18 +31,11 @@ impl<T> Mutex<T> {

#[cfg(feature = "sync")]
impl EmptyCondvar {
#[cfg(not(latches_no_const_sync))]
#[must_use]
#[inline]
pub(crate) const fn new() -> Self {
Self(Mutex::new(()), StdCondvar::new())
}
#[cfg(latches_no_const_sync)]
#[must_use]
#[inline]
pub(crate) fn new() -> Self {
Self(Mutex::new(()), StdCondvar::new())
}

/// Notifies all threads waiting on this condition variable.
///
Expand Down
12 changes: 0 additions & 12 deletions latches/src/sync/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ impl Latch {
/// let latch = Latch::new(10);
/// # drop(latch);
/// ```
#[cfg(not(latches_no_const_sync))]
#[must_use]
#[inline]
pub const fn new(count: usize) -> Self {
Expand All @@ -123,17 +122,6 @@ impl Latch {
cvar: EmptyCondvar::new(),
}
}
/// Creates a new latch initialized with the given count.
#[cfg(latches_no_const_sync)]
#[must_use]
#[inline]
pub fn new(count: usize) -> Self {
Self {
stat: AtomicUsize::new(count),
lock: Mutex::new(()),
cvar: Condvar::new(),
}
}

/// Decrements the latch count, re-enable all waiting threads if the
/// counter reaches 0 after decrement.
Expand Down
11 changes: 0 additions & 11 deletions latches/src/task/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ impl Latch {
/// let latch = Latch::new(10);
/// # drop(latch);
/// ```
#[cfg(not(latches_no_const_sync))]
#[must_use]
#[inline]
pub const fn new(count: usize) -> Self {
Expand All @@ -122,16 +121,6 @@ impl Latch {
lock: Mutex::new(Waiters::new()),
}
}
/// Creates a new latch initialized with the given count.
#[cfg(latches_no_const_sync)]
#[must_use]
#[inline]
pub fn new(count: usize) -> Self {
Self {
stat: AtomicUsize::new(count),
lock: Mutex::new(Waiters::new()),
}
}

/// Decrements the latch count, wake up all pending tasks if the counter
/// reaches 0 after decrement.
Expand Down

0 comments on commit 6a6487f

Please sign in to comment.