Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ name: Check
on:
push:
branches:
- master
- main
paths:
- "Cargo.toml"
- "**/*.rs"
- ".github/workflows/ci_check.yml"
pull_request:
branches:
- master
- main
paths:
- "Cargo.toml"
- "**/*.rs"
Expand All @@ -25,7 +25,7 @@ env:

jobs:
check:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Rust Toolchain
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci_check_minimal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ name: Check (Minimal Versions)
on:
push:
branches:
- master
- main
paths:
- "Cargo.toml"
- "**/*.rs"
- ".github/workflows/ci_check_minimal.yml"
pull_request:
branches:
- master
- main
paths:
- "Cargo.toml"
- "**/*.rs"
Expand All @@ -25,7 +25,7 @@ env:

jobs:
check:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Rust Toolchain
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci_format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ name: Check Code Format
on:
push:
branches:
- master
- main
paths:
- "rustfmt.toml"
- "Cargo.toml"
- "**/*.rs"
- ".github/workflows/ci_format.yml"
pull_request:
branches:
- master
- main
paths:
- "rustfmt.toml"
- "**/*.rs"
Expand All @@ -22,7 +22,7 @@ env:

jobs:
check:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Rust Toolchain
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ watch = ["dep:see"]
mutex = ["dep:futures", "dep:slab", "futures?/std"]
waker_slot = ["dep:futures"]
event = ["dep:event-listener", "dep:local-event"]
bilock = ["waker_slot"]

[dev-dependencies]
futures = { version = "0.3.31", features = ["executor"] }
12 changes: 6 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@
{
devShells.default = mkShell {
buildInputs = [
go
cmake
glib
lldb
openssl
pkg-config
(rust-bin.selectLatestNightlyWith (
toolchain:
toolchain.default.override {
Expand Down
6 changes: 1 addition & 5 deletions src/atomic/unsync.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
use std::{
cell::Cell,
fmt::{Debug, Display},
sync::atomic::Ordering,
};
use std::{cell::Cell, fmt::Debug, sync::atomic::Ordering};

atomic_int!(AtomicU8(u8));
atomic_int!(AtomicU16(u16));
Expand Down
29 changes: 20 additions & 9 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,16 @@
#![warn(missing_docs)]
#![deny(rustdoc::broken_intra_doc_links)]

#[cfg(feature = "bilock")]
mod bilock;
#[cfg(feature = "event")]
mod event;
#[cfg(feature = "mutex")]
mod mutex;

#[cfg(feature = "waker_slot")]
mod waker_slot;

#[cfg(feature = "event")]
mod event;

mod atomic;
mod bilock;
mod flag;
mod mutex_blocking;
mod shared;
Expand All @@ -63,6 +62,12 @@ pub mod sync {
#[cfg(feature = "watch")]
pub use see::sync as watch;

#[doc(inline)]
#[cfg(feature = "bilock")]
pub use crate::bilock::sync as bilock;
#[doc(inline)]
#[cfg(feature = "event")]
pub use crate::event::sync as event;
#[doc(inline)]
#[cfg(feature = "mutex")]
pub use crate::mutex::sync as mutex;
Expand All @@ -71,8 +76,8 @@ pub mod sync {
pub use crate::waker_slot::sync as waker_slot;
#[doc(inline)]
pub use crate::{
atomic::sync as atomic, bilock::sync as bilock, event::sync as event, flag::sync as flag,
mutex_blocking::sync as mutex_blocking, shared::sync as shared,
atomic::sync as atomic, flag::sync as flag, mutex_blocking::sync as mutex_blocking,
shared::sync as shared,
};
}

Expand All @@ -83,6 +88,12 @@ pub mod unsync {
#[cfg(feature = "watch")]
pub use see::unsync as watch;

#[doc(inline)]
#[cfg(feature = "bilock")]
pub use crate::bilock::unsync as bilock;
#[doc(inline)]
#[cfg(feature = "event")]
pub use crate::event::unsync as event;
#[doc(inline)]
#[cfg(feature = "mutex")]
pub use crate::mutex::unsync as mutex;
Expand All @@ -91,8 +102,8 @@ pub mod unsync {
pub use crate::waker_slot::unsync as waker_slot;
#[doc(inline)]
pub use crate::{
atomic::unsync as atomic, bilock::unsync as bilock, event::unsync as event,
flag::unsync as flag, mutex_blocking::unsync as mutex_blocking, shared::unsync as shared,
atomic::unsync as atomic, flag::unsync as flag, mutex_blocking::unsync as mutex_blocking,
shared::unsync as shared,
};
}

Expand Down
8 changes: 4 additions & 4 deletions src/mutex_blocking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ pub mod sync {
type Target = T;

fn deref(&self) -> &Self::Target {
&*self.0
&self.0
}
}

impl<'a, T> DerefMut for MutexGuard<'a, T> {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut *self.0
&mut self.0
}
}

Expand Down Expand Up @@ -118,13 +118,13 @@ pub mod unsync {
type Target = T;

fn deref(&self) -> &Self::Target {
&*self.0
&self.0
}
}

impl<'a, T> DerefMut for MutexGuard<'a, T> {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut *self.0
&mut self.0
}
}
}