watercooler-labs / toggl-cli

🕐 Command Line App for Toggl Track
MIT License
31 stars 7 forks source link

⚠️ Simplify code by using Result #2

Closed heytherewill closed 3 years ago

heytherewill commented 3 years ago

This massively simplifies a lot of the code by piggybacking on the fact that we can use unwrap Results if the current method also returns a result. Basically we are using results everywhere and the result (pun intended) is less match boilerplate.

I also used a typealias for the result type to prevent writing Box<dyn std::error::Error> all the time, which is quite hard on the eyes