Skip to content

Commit a980579

Browse files
committed
Avoid struct<Gneric = ()> in cbindgen-read definitions
Works around mozilla/cbindgen#993 in cbindgen 0.27+ Signed-off-by: Bob Weinand <[email protected]>
1 parent 8dff9b8 commit a980579

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

ipc/src/rate_limiter.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ struct ShmLimiterData<'a, Inner> {
2121
_phantom: PhantomData<&'a ShmLimiterMemory<Inner>>,
2222
}
2323

24-
pub struct ShmLimiterMemory<Inner = ()> {
24+
pub struct ShmLimiterMemory<Inner> {
2525
mem: Arc<RwLock<MappedMem<NamedShmHandle>>>,
2626
last_size: AtomicU32,
2727
_phantom: PhantomData<Inner>,
@@ -195,7 +195,7 @@ impl<Inner> ShmLimiterMemory<Inner> {
195195
}
196196
}
197197

198-
pub struct ShmLimiter<Inner = ()> {
198+
pub struct ShmLimiter<Inner> {
199199
idx: u32,
200200
memory: ShmLimiterMemory<Inner>,
201201
}
@@ -295,7 +295,7 @@ impl<Inner> Drop for ShmLimiter<Inner> {
295295

296296
pub enum AnyLimiter {
297297
Local(LocalLimiter),
298-
Shm(ShmLimiter),
298+
Shm(ShmLimiter<()>),
299299
}
300300

301301
impl AnyLimiter {

sidecar/src/shm_remote_config.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ struct ConfigFileStorage {
127127

128128
struct StoredShmFile {
129129
handle: Mutex<NamedShmHandle>,
130-
limiter: Option<ShmLimiter>,
130+
limiter: Option<ShmLimiter<()>>,
131131
refcount: FileRefcountData,
132132
}
133133

sidecar/src/tracer.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ use std::ffi::CString;
1010
use std::str::FromStr;
1111
use std::sync::{Mutex, OnceLock};
1212

13-
static SHM_LIMITER: OnceLock<Mutex<ShmLimiterMemory>> = OnceLock::new();
13+
static SHM_LIMITER: OnceLock<Mutex<ShmLimiterMemory<()>>> = OnceLock::new();
1414

15-
pub fn get_shm_limiter() -> &'static Mutex<ShmLimiterMemory> {
15+
pub fn get_shm_limiter() -> &'static Mutex<ShmLimiterMemory<()>> {
1616
#[allow(clippy::unwrap_used)]
1717
SHM_LIMITER.get_or_init(|| Mutex::new(ShmLimiterMemory::create(shm_limiter_path()).unwrap()))
1818
}

0 commit comments

Comments
 (0)