vrruiz / xisfits

Convert images from XISF to FITS
MIT License
8 stars 0 forks source link

Use "typed" type formats #6

Closed Razican closed 4 years ago

Razican commented 4 years ago

The XISFHeader structure currently uses a String to store a Type format. Given that the number of options is a reduced set, it would probably be more convenient to use a Rust enum which can also have a num_bytes() function that directly returns the number of bytes. This would improve performance a bit, RAM usage a bit, and make the code more maintainable and more clear.

Let me know what you think, and I can implement it.

vrruiz commented 4 years ago

I think it could be useful to store the raw value, in case the header is not properly formatted, but yeah why not. Let's go ahead with the enum.