Skip to content

Commit d96436e

Browse files
bors[bot]pacak
andauthored
Merge #1786
1786: Folloup for !1778, remove some of the less helpful error msgs r=asomers a=pacak Co-authored-by: Michael Baikov <manpacket@gmail.com>
2 parents d9a7904 + 384d47d commit d96436e

File tree

4 files changed

+14
-19
lines changed

4 files changed

+14
-19
lines changed

src/sys/signalfd.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,18 +147,17 @@ mod tests {
147147
#[test]
148148
fn create_signalfd() {
149149
let mask = SigSet::empty();
150-
let fd = SignalFd::new(&mask);
151-
fd.expect("assert failed");
150+
SignalFd::new(&mask).unwrap();
152151
}
153152

154153
#[test]
155154
fn create_signalfd_with_opts() {
156155
let mask = SigSet::empty();
157-
let fd = SignalFd::with_flags(
156+
SignalFd::with_flags(
158157
&mask,
159158
SfdFlags::SFD_CLOEXEC | SfdFlags::SFD_NONBLOCK,
160-
);
161-
fd.expect("assert failed");
159+
)
160+
.unwrap();
162161
}
163162

164163
#[test]

test/sys/test_aio.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,7 @@ mod aio_fsync {
101101
0,
102102
SigevNotify::SigevNone,
103103
));
104-
let err = aiof.as_mut().submit();
105-
err.expect("assert failed");
104+
aiof.as_mut().submit().unwrap();
106105
poll_aio!(&mut aiof).unwrap();
107106
aiof.as_mut().aio_return().unwrap();
108107
}
@@ -148,8 +147,7 @@ mod aio_read {
148147
Box::pin(AioRead::new(fd, 2, &mut rbuf, 0, SigevNotify::SigevNone));
149148
aior.as_mut().submit().unwrap();
150149

151-
let cancelstat = aior.as_mut().cancel();
152-
cancelstat.expect("assert failed");
150+
aior.as_mut().cancel().unwrap();
153151

154152
// Wait for aiow to complete, but don't care whether it succeeded
155153
let _ = poll_aio!(&mut aior);
@@ -341,8 +339,7 @@ mod aio_write {
341339
let err = aiow.as_mut().error();
342340
assert!(err == Ok(()) || err == Err(Errno::EINPROGRESS));
343341

344-
let cancelstat = aiow.as_mut().cancel();
345-
cancelstat.expect("assert failed");
342+
aiow.as_mut().cancel().unwrap();
346343

347344
// Wait for aiow to complete, but don't care whether it succeeded
348345
let _ = poll_aio!(&mut aiow);
@@ -564,8 +561,7 @@ fn test_aio_cancel_all() {
564561
let err = aiocb.as_mut().error();
565562
assert!(err == Ok(()) || err == Err(Errno::EINPROGRESS));
566563

567-
let cancelstat = aio_cancel_all(f.as_raw_fd());
568-
cancelstat.expect("assert failed");
564+
aio_cancel_all(f.as_raw_fd()).unwrap();
569565

570566
// Wait for aiocb to complete, but don't care whether it succeeded
571567
let _ = poll_aio!(&mut aiocb);

test/sys/test_termios.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ fn test_tcgetattr_pty() {
2222
let _m = crate::PTSNAME_MTX.lock();
2323

2424
let pty = openpty(None, None).expect("openpty failed");
25-
termios::tcgetattr(pty.slave).expect("assert failed");
25+
termios::tcgetattr(pty.slave).unwrap();
2626
close(pty.master).expect("closing the master failed");
2727
close(pty.slave).expect("closing the slave failed");
2828
}

test/test_time.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,18 @@ pub fn test_clock_gettime() {
2929
#[test]
3030
pub fn test_clock_getcpuclockid() {
3131
let clock_id = clock_getcpuclockid(nix::unistd::Pid::this()).unwrap();
32-
clock_gettime(clock_id).expect("assert failed");
32+
clock_gettime(clock_id).unwrap();
3333
}
3434

3535
#[cfg(not(target_os = "redox"))]
3636
#[test]
3737
pub fn test_clock_id_res() {
38-
ClockId::CLOCK_REALTIME.res().expect("assert failed");
38+
ClockId::CLOCK_REALTIME.res().unwrap();
3939
}
4040

4141
#[test]
4242
pub fn test_clock_id_now() {
43-
ClockId::CLOCK_REALTIME.now().expect("assert failed");
43+
ClockId::CLOCK_REALTIME.now().unwrap();
4444
}
4545

4646
#[cfg(any(
@@ -54,6 +54,6 @@ pub fn test_clock_id_now() {
5454
pub fn test_clock_id_pid_cpu_clock_id() {
5555
ClockId::pid_cpu_clock_id(nix::unistd::Pid::this())
5656
.map(ClockId::now)
57-
.expect("assert failed")
58-
.expect("assert failed");
57+
.unwrap()
58+
.unwrap();
5959
}

0 commit comments

Comments
 (0)