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: add FitsFile::file_path method to access FitsFile file path #367

Merged
merged 2 commits into from
Oct 31, 2024

Conversation

simonrw
Copy link
Owner

@simonrw simonrw commented Oct 30, 2024

Include a method to access the file path of the FitsFile.

During my investigation I found that there was no reason to make it optional. Given this, I have made the field/function return non-optional as well.

Also: it is stored as a PathBuf internally, and inherently refers to a path on disk, so let's return a Path in that case.

Closes #366

@simonrw simonrw changed the title Feat/filename method feat: add FitsFile::file_path method to access FitsFile file path Oct 30, 2024
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 97.87234% with 1 line in your changes missing coverage. Please review.

Project coverage is 89.3%. Comparing base (01ed20c) to head (68ef302).

Files with missing lines Patch % Lines
fitsio/src/fitsfile.rs 97.5% 1 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
fitsio/src/longnam.rs 88.3% <100.0%> (+0.1%) ⬆️
fitsio/src/fitsfile.rs 95.1% <97.5%> (+0.1%) ⬆️

d3v-null added a commit to MWATelescope/mwa_hyperdrive that referenced this pull request Oct 31, 2024
d3v-null added a commit to MWATelescope/mwalib that referenced this pull request Oct 31, 2024
@simonrw simonrw merged commit b3c5069 into main Oct 31, 2024
11 checks passed
@simonrw simonrw deleted the feat/filename-method branch October 31, 2024 11:17
@simonrw simonrw mentioned this pull request Oct 13, 2024
simonrw added a commit that referenced this pull request Oct 31, 2024
## 🤖 New release
* `fitsio`: 0.21.5 -> 0.21.6 (✓ API compatible changes)
* `fitsio-sys`: 0.5.3 -> 0.5.4 (✓ API compatible changes)

<details><summary><i><b>Changelog</b></i></summary><p>

## `fitsio`
<blockquote>

##
[0.21.6](fitsio-v0.21.5...fitsio-v0.21.6)
- 2024-10-31

### Added

- add `FitsFile::file_path` method to access `FitsFile` file path
([#367](#367))

### Other

- Allow needless-lifetimes
([#363](#363))
</blockquote>

## `fitsio-sys`
<blockquote>

##
[0.5.4](fitsio-sys-v0.5.3...fitsio-sys-v0.5.4)
- 2024-10-31

### Other

- *(deps)* update bindgen requirement from 0.69 to 0.70 in /fitsio-sys
in the cargo-packages group
([#357](#357))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/MarcoIeni/release-plz/).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API to get (optional) filename for FitsFile struct
2 participants