We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a8a99cf commit adc629eCopy full SHA for adc629e
1 file changed
fitsio/examples/reading_from_memory.rs
@@ -10,6 +10,8 @@ use std::io::Read;
10
#[cfg(all(target_pointer_width = "64", target_os = "linux"))]
11
fn main() {
12
// read the bytes into memory and return a pointer and length to the file
13
+
14
+ use fitsio::errors::check_status;
15
let (bytes, mut ptr_size) = {
16
let filename = "./testdata/full_example.fits";
17
let mut f = std::fs::File::open(filename).unwrap();
@@ -39,10 +41,7 @@ fn main() {
39
41
);
40
42
}
43
- if status != 0 {
- unsafe { sys::ffrprt(sys::stderr, status) };
44
- panic!("bad status");
45
- }
+ check_status(status).unwrap();
46
47
let mut f = unsafe { FitsFile::from_raw(fptr, FileOpenMode::READONLY) }.unwrap();
48
f.pretty_print().expect("pretty printing fits file");
0 commit comments