Skip to content

Commit

Permalink
feat: remove i32 and f32 header parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
simonrw committed Dec 21, 2022
1 parent 18a98c6 commit e65519c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,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 @@ -28,6 +30,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

0 comments on commit e65519c

Please sign in to comment.