Skip to content
This repository was archived by the owner on Dec 2, 2020. It is now read-only.

Commit a790cd5

Browse files
Ignore errors instead
1 parent 5fbd612 commit a790cd5

File tree

1 file changed

+4
-25
lines changed

1 file changed

+4
-25
lines changed

src/export.rs

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,64 +9,43 @@ use crate::hio::{self, HStderr, HStdout};
99
static mut HSTDOUT: Option<HStdout> = None;
1010

1111
pub fn hstdout_str(s: &str) {
12-
let result = interrupt::free(|_| unsafe {
12+
let _result = interrupt::free(|_| unsafe {
1313
if HSTDOUT.is_none() {
1414
HSTDOUT = Some(hio::hstdout()?);
1515
}
1616

1717
HSTDOUT.as_mut().unwrap().write_str(s).map_err(drop)
1818
});
19-
20-
if result.is_err() {
21-
error("hstdout");
22-
}
2319
}
2420

2521
pub fn hstdout_fmt(args: fmt::Arguments) {
26-
let result = interrupt::free(|_| unsafe {
22+
let _result = interrupt::free(|_| unsafe {
2723
if HSTDOUT.is_none() {
2824
HSTDOUT = Some(hio::hstdout()?);
2925
}
3026

3127
HSTDOUT.as_mut().unwrap().write_fmt(args).map_err(drop)
3228
});
33-
34-
if result.is_err() {
35-
error("hstdout");
36-
}
3729
}
3830

3931
static mut HSTDERR: Option<HStderr> = None;
4032

4133
pub fn hstderr_str(s: &str) {
42-
let result = interrupt::free(|_| unsafe {
34+
let _result = interrupt::free(|_| unsafe {
4335
if HSTDERR.is_none() {
4436
HSTDERR = Some(hio::hstderr()?);
4537
}
4638

4739
HSTDERR.as_mut().unwrap().write_str(s).map_err(drop)
4840
});
49-
50-
if result.is_err() {
51-
error("hstderr");
52-
}
5341
}
5442

5543
pub fn hstderr_fmt(args: fmt::Arguments) {
56-
let result = interrupt::free(|_| unsafe {
44+
let _result = interrupt::free(|_| unsafe {
5745
if HSTDERR.is_none() {
5846
HSTDERR = Some(hio::hstderr()?);
5947
}
6048

6149
HSTDERR.as_mut().unwrap().write_fmt(args).map_err(drop)
6250
});
63-
64-
if result.is_err() {
65-
error("hstderr");
66-
}
67-
}
68-
69-
#[cold]
70-
fn error(label: &str) {
71-
panic!("failed to print to {}", label);
7251
}

0 commit comments

Comments
 (0)