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.
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 noelse
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.