gevhaz / Lightningfocus

Multitasking for those who can't

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Define new error type and remove map_err()

gevhaz opened this issue · comments

commented

Currently, Lightningfocus makes use of the map_err() function in a few cases so that my function can return a string even when a function I call returns something else in case of errors. It is more idiomatic to define a new error type and use ?. Do this.

Note: There are some crates that help avoid the boilerplate involved with defining new error types, namely anyhow and thiserror. Investigate using these.