Skip to content

Commit a81dba7

Browse files
author
Bryant Mairs
committed
Use Rc::clone() instead of .clone()
Makes it more clear what's being cloned
1 parent 33235f6 commit a81dba7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/sys/test_aio.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ fn test_aio_suspend() {
150150

151151
let mut rcb = AioCb::from_boxed_slice( f.as_raw_fd(),
152152
8, //offset
153-
rbuf.clone(),
153+
Rc::clone(&rbuf),
154154
0, //priority
155155
SigevNotify::SigevNone,
156156
LioOpcode::LIO_READ);
@@ -184,7 +184,7 @@ fn test_read() {
184184
{
185185
let mut aiocb = AioCb::from_boxed_slice( f.as_raw_fd(),
186186
2, //offset
187-
rbuf.clone(),
187+
Rc::clone(&rbuf),
188188
0, //priority
189189
SigevNotify::SigevNone,
190190
LioOpcode::LIO_NOP);
@@ -211,7 +211,7 @@ fn test_read_error() {
211211
f.write_all(INITIAL).unwrap();
212212
let mut aiocb = AioCb::from_boxed_slice( f.as_raw_fd(),
213213
-1, //an invalid offset
214-
rbuf.clone(),
214+
Rc::clone(&rbuf),
215215
0, //priority
216216
SigevNotify::SigevNone,
217217
LioOpcode::LIO_NOP);
@@ -383,7 +383,7 @@ fn test_lio_listio_wait() {
383383

384384
let mut rcb = AioCb::from_boxed_slice( f.as_raw_fd(),
385385
8, //offset
386-
rbuf.clone(),
386+
Rc::clone(&rbuf),
387387
0, //priority
388388
SigevNotify::SigevNone,
389389
LioOpcode::LIO_READ);
@@ -426,7 +426,7 @@ fn test_lio_listio_nowait() {
426426

427427
let mut rcb = AioCb::from_boxed_slice( f.as_raw_fd(),
428428
8, //offset
429-
rbuf.clone(),
429+
Rc::clone(&rbuf),
430430
0, //priority
431431
SigevNotify::SigevNone,
432432
LioOpcode::LIO_READ);
@@ -479,7 +479,7 @@ fn test_lio_listio_signal() {
479479

480480
let mut rcb = AioCb::from_boxed_slice( f.as_raw_fd(),
481481
8, //offset
482-
rbuf.clone(),
482+
Rc::clone(&rbuf),
483483
0, //priority
484484
SigevNotify::SigevNone,
485485
LioOpcode::LIO_READ);

0 commit comments

Comments
 (0)