Skip to content

Commit b8ad775

Browse files
authored
style: use string literal for magic (#60)
1 parent 6cc1995 commit b8ad775

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/mpmc.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ use std::{
99
sync::{atomic::AtomicU64, Arc},
1010
};
1111

12-
const MAGIC: u64 = 0x7368_6171_6d70_6d63; // b"shaqmpmc"
12+
/// Unique identifier for MPMC queue in shared memory.
13+
const MAGIC: u64 = u64::from_be_bytes(*b"shaqmpmc");
1314

1415
pub struct Producer<T> {
1516
queue: SharedQueue<T>,

src/spsc.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ use std::{
1010
},
1111
};
1212

13-
const MAGIC: u64 = 0x7368_6171_7370_7363; // b"shaqspsc"
13+
/// Unique identifier for SPSC queue in shared memory.
14+
const MAGIC: u64 = u64::from_be_bytes(*b"shaqspsc");
1415

1516
/// Calculates the minimum file size required for a queue with given capacity.
1617
/// Note that file size MAY need to be increased beyond this to account for

0 commit comments

Comments
 (0)