rchriste / OnPurpose

On-Purpose: Intuitive Time Management
MIT License
5 stars 1 forks source link

Implement unwrap() calls #2

Open rchriste opened 1 week ago

rchriste commented 1 week ago

The codebase has a lot of "unwrap" calls (420 as of 9/9/2024). Each of these represents a potential crash point in the program. One of the things that you could do is review these unwrap calls and either handle the potential error or otherwise deal with the unwrap so it is no longer in the code base. For example, in unit tests these unwrap calls could be switched over to expect calls with a message that this is a unit test setup failure or something of that effect.

Otherwise you could look into Rust error crates and determine if it is appropriate to change the return type of the function so the error is returned to the proper level and look into Rust crates for error handling.

Note that if you work on this item the goal is NOT to address all unwrap calls in one go rather it is to make a check-in that improves the situation. Find a couple of places or a scenario to improvement things with and feel free to reach out to me to understand the code. And make a PR that addresses that one scenario.

rchriste commented 1 week ago

This would reduce the amount of unwrap calls. https://github.com/rchriste/OnPurpose/issues/3

rchriste commented 2 days ago

I'm working on this.