Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Give the user access to the underlying fitsio_sys::fitsfile object #32

Merged
merged 2 commits into from
Apr 30, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion fitsio-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fn main() {
let stderr = String::from_utf8(output.stderr).unwrap();
if stderr.contains::<&str>(format!("{} was not found in the pkg-config search path",
package_name)
.as_ref()) {
.as_ref()) {
let err_msg = format!("
Cannot find {} on the pkg-config search path. Consider installing the library for your
system (e.g. through homebrew, apt-get etc.). Alternatively if it is installed, then add
Expand Down
28 changes: 16 additions & 12 deletions fitsio-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,8 @@ extern "C" {
buffsize: *mut size_t,
deltasize: size_t,
mem_realloc: ::std::option::Option<unsafe extern "C" fn(p: *mut c_void,
newsize: size_t)
-> *mut c_void>,
newsize: size_t)
-> *mut c_void>,
status: *mut c_int)
-> c_int;
pub fn ffopen(fptr: *mut *mut fitsfile,
Expand Down Expand Up @@ -454,8 +454,8 @@ extern "C" {
buffsize: *mut size_t,
deltasize: size_t,
mem_realloc: ::std::option::Option<unsafe extern "C" fn(p: *mut c_void,
newsize: size_t)
-> *mut c_void>,
newsize: size_t)
-> *mut c_void>,
status: *mut c_int)
-> c_int;
pub fn fftplt(fptr: *mut *mut fitsfile,
Expand Down Expand Up @@ -3644,13 +3644,13 @@ extern "C" {
offset: c_long,
nPerLoop: c_long,
workFn: ::std::option::Option<unsafe extern "C" fn(totaln: c_long,
offset: c_long,
firstn: c_long,
nvalues: c_long,
narrays: c_int,
data: *mut iteratorCol,
userPointer: *mut c_void)
-> c_int>,
offset: c_long,
firstn: c_long,
nvalues: c_long,
narrays: c_int,
data: *mut iteratorCol,
userPointer: *mut c_void)
-> c_int>,
userPointer: *mut c_void,
status: *mut c_int)
-> c_int;
Expand Down Expand Up @@ -4577,7 +4577,11 @@ mod test {
assert_eq!(double_value, 3. / 32.);

// TODO Hacky way of getting a string out. This should be simplified.
let comment: Vec<u8> = comment.iter().map(|&x| x as u8).filter(|&x| x != 0).collect();
let comment: Vec<u8> = comment
.iter()
.map(|&x| x as u8)
.filter(|&x| x != 0)
.collect();
let comment = String::from_utf8(comment).unwrap();
assert_eq!(comment, "Double value");
}
Expand Down
14 changes: 7 additions & 7 deletions fitsio/src/columndescription.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ impl ColumnDescription {
match self.data_type {
Some(ref d) => {
Ok(ConcreteColumnDescription {
name: self.name.clone(),
data_type: d.clone(),
})
name: self.name.clone(),
data_type: d.clone(),
})
}
None => {
Err("No data type given. Ensure the `with_type` method has been called.".into())
Expand Down Expand Up @@ -218,10 +218,10 @@ impl FromStr for ColumnDataDescription {
};

Ok(ColumnDataDescription {
repeat: repeat,
typ: data_type,
width: width,
})
repeat: repeat,
typ: data_type,
width: width,
})
}
}

Expand Down
6 changes: 3 additions & 3 deletions fitsio/src/fitserror.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ pub type FitsResult<T> = result::Result<T, FitsError>;

pub fn status_to_error(status: i32) -> FitsResult<()> {
Err(FitsError {
status: status,
message: status_to_string(status).unwrap(),
})
status: status,
message: status_to_string(status).unwrap(),
})
}

#[cfg(test)]
Expand Down
Loading