vrruiz / xisfits

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

Changed from ifs to matches to simplify the parsing #11

Closed Razican closed 4 years ago

Razican commented 4 years ago

This reduces the complexity of the function a bit, and makes it easier to understand when reading the code. It also fixes the error in the builds regarding the complexity of the function.

Using match will force you to check for all possible options, and to at least provide a blanked implementation in case that the specified options are not satisfied. I used an empty "default" since there was no else in the code, but I added (commented) a potential warning message if you want to enable it. I will comment on the code to make it more clear.