mirror of
https://github.com/status-im/nim-stew.git
synced 2025-01-10 04:05:44 +00:00
d2ae2889e8
* `Result` refresh * add full support for `Result[T, void]` (aka `Opt[T]` aka `Option[T]`) * expand tests * add `flatten`, `filter` of `Option` fame * add `tryError` that raises a regular exception when result holds a value * fix `$` to print `ok`/`err` in lower-case, like the functions that created the result * add `orErr` that collapses all errors to a single value of a potentially different type - useful when translating errors between layers * `capture` should work with `CatchableError` * remove `Defect`-dependent tests * Update stew/results.nim * avoid redundant error message when converting error to string * avoid multiple evaluation in `valueOr` * add `unsafeError` to match `unsafeGet` * let `valueOr` evaluate a block * add `errorOr` to mirror `valueOr`
Candidates for standard library inclusion - functions and helpers that are too small to put in their own git repository