Skip to content

Commit 308ff06

Browse files
committed
Fix test/example lints
1 parent 2145bec commit 308ff06

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

examples/basic.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,7 @@ fn increment_value(shmem_flink: &str, thread_num: usize, max: u8) {
4848
Ok(m) => m,
4949
Err(ShmemError::LinkExists) => ShmemConf::new().flink(shmem_flink).open().unwrap(),
5050
Err(e) => {
51-
eprintln!(
52-
"Unable to create or open shmem flink {} : {}",
53-
shmem_flink, e
54-
);
51+
eprintln!("Unable to create or open shmem flink {shmem_flink} : {e}");
5552
return;
5653
}
5754
};

tests/general.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ fn open_flink() {
6969
let s1 = ShmemConf::new().flink(flink).size(4090).create().unwrap();
7070

7171
// Open with file base link
72-
let mut s2 = ShmemConf::new().flink(&flink).open().unwrap();
72+
let mut s2 = ShmemConf::new().flink(flink).open().unwrap();
7373

7474
assert!(!s2.is_owner());
7575
assert!(!s2.get_os_id().is_empty());
@@ -85,7 +85,7 @@ fn open_flink() {
8585
drop(s1);
8686

8787
// Make sure it can be openned again
88-
assert!(ShmemConf::new().flink(&flink).open().is_err());
88+
assert!(ShmemConf::new().flink(flink).open().is_err());
8989

9090
drop(s2);
9191
}
@@ -99,7 +99,7 @@ fn share_data() {
9999

100100
// Open with the unique os id
101101
let os_id = s1.get_os_id().to_string();
102-
let s2 = ShmemConf::new().os_id(&os_id).open().unwrap();
102+
let s2 = ShmemConf::new().os_id(os_id).open().unwrap();
103103

104104
let ptr1 = s1.as_ptr() as *mut u32;
105105
let ptr2 = s2.as_ptr() as *mut u32;

tests/posix_semantics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ fn posix_behavior() {
7777
// This thread keeps a shared memory instance alive until it's told to
7878
// drop it.
7979
let existing_os_id = rx_c.recv().unwrap();
80-
let _shmem = ShmemConf::new().os_id(&existing_os_id).open().unwrap();
80+
let _shmem = ShmemConf::new().os_id(existing_os_id).open().unwrap();
8181
// Indicate to thread A that the instance has been created.
8282
tx_a.send(String::new()).unwrap();
8383
// Shut down signal.

0 commit comments

Comments
 (0)