Recipes & Ideas
This chapter collects smaller ideas enabled by hooq.
Practical usage has already been shown in the Tutorial. These entries may be less practical but explore possibilities and might inspire new use cases.
Contents
| Page | Summary |
|---|---|
| Perfect color-eyre | Use color-eyre for BACKTRACE/SPANTRACE, while also getting hooq’s pseudo trace for maximum insight. |
| Batch apply under a module | hooq can be attached to items like mod to hook inner functions recursively. |
| Using in functions returning Option | Adjust tail_expr_idents and result_types to target Option returns. |
Turn ? into .unwrap() behind a feature | Use #[cfg_attr(...)] to change behavior conditionally. |
Reinvent match desugaring | Replace ? with match using consume-question + custom flavor. |