Skip to content

Commit 7ef130e

Browse files
committed
fix lint
1 parent d00f8cf commit 7ef130e

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

examples/mutex.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ fn increment_value(shmem_flink: &str, thread_num: usize) {
5757
let is_init: &mut AtomicU8;
5858

5959
unsafe {
60-
is_init = &mut *(raw_ptr as *mut u8 as *mut AtomicU8);
60+
is_init = &mut *(raw_ptr as *mut AtomicU8);
6161
raw_ptr = raw_ptr.add(8);
6262
};
6363

src/unix.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
use std::num::NonZeroUsize;
22
use std::os::unix::io::RawFd;
33
use std::ptr::null_mut;
4+
use std::os::unix::fs::OpenOptionsExt;
5+
use std::os::unix::io::AsRawFd;
46

57
use crate::log::*;
68
use nix::fcntl::OFlag;
@@ -245,8 +247,6 @@ pub fn create_mapping_tmpfs(
245247
map_size: usize,
246248
mode: Option<Mode>,
247249
) -> Result<MapData, ShmemError> {
248-
use std::os::unix::fs::OpenOptionsExt;
249-
use std::os::unix::io::AsRawFd;
250250

251251
let nz_map_size = NonZeroUsize::new(map_size).ok_or(ShmemError::MapSizeZero)?;
252252
let mode_bits = mode.unwrap_or(Mode::S_IRUSR | Mode::S_IWUSR).bits();
@@ -258,7 +258,7 @@ pub fn create_mapping_tmpfs(
258258
.create_new(true)
259259
.read(true)
260260
.write(true)
261-
.mode(mode_bits)
261+
.mode(mode_bits.into())
262262
.open(file_path)
263263
.map_err(|e| match e.kind() {
264264
std::io::ErrorKind::AlreadyExists => ShmemError::MappingIdExists,

0 commit comments

Comments
 (0)