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

feat: remove i32 and f32 header parsing #170

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a

### Removed

* (`fitsio`) **BREAKING CHANGE** Removed the ability to read `i32` and `f32` header values. Instead, please use the `i64` and `f64` equivalents. This is because there is a bug in reading `i32` values in that they are read as "logical" i.e. 0 or 1. This led me to decide that we don't need to differentiate between `x32` and `x64` types for header values. See the [conversation here](https://github.com/simonrw/rust-fitsio/issues/167) [#170](https://github.com/simonrw/rust-fitsio/pull/170)

## [0.21.0]
### Added

* The abillity to create a `FitsFile` struct from a `fitsio_sys::fitsfile` pointer [#195](https://github.com/simonrw/rust-fitsio/pull/195)
* Support for boolean header card values
* `fitsio-sys` (whichever feature is used) is exposed as `fitsio::sys` to make sure that only one crate that links to the system library exists [#195](https://github.com/simonrw/rust-fitsio/pull/174)
* (`fitsio`) Support for boolean header card values

### Changed

Expand All @@ -39,6 +41,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
* Some more types are deriving `Eq` thanks to a clippy lint
* Fixed broken tests on m1 macos [#174](https://github.com/simonrw/rust-fitsio/pull/174)
* Minimum cfitsio version of 3.37 specified for compilation [#184](https://github.com/simonrw/rust-fitsio/pull/184)
* (`fitsio`) Some more types are deriving `Eq` thanks to a clippy lint

### Removed

## [0.20.0]
### Added
Expand Down
4 changes: 1 addition & 3 deletions fitsio/src/headers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,18 @@ macro_rules! reads_key_impl {
};
}

reads_key_impl!(i32, fits_read_key_log);
#[cfg(all(target_pointer_width = "64", not(target_os = "windows")))]
reads_key_impl!(i64, fits_read_key_lng);
#[cfg(any(target_pointer_width = "32", target_os = "windows"))]
reads_key_impl!(i64, fits_read_key_lnglng);
reads_key_impl!(f32, fits_read_key_flt);
reads_key_impl!(f64, fits_read_key_dbl);

impl ReadsKey for bool {
fn read_key(f: &mut FitsFile, name: &str) -> Result<Self>
where
Self: Sized,
{
let int_value = i32::read_key(f, name)?;
let int_value = i64::read_key(f, name)?;
Ok(int_value > 0)
}
}
Expand Down