ash-project / igniter

A code generation and project patching framework.
https://hexdocs.pm/igniter/readme.html
MIT License
106 stars 10 forks source link

refactor: simplify zipper usage #45

Closed zachallaun closed 2 months ago

zachallaun commented 2 months ago

I love just browsing and reading code, and while doing so with Igniter, noticed some zipper usage that couple be simplified.

Commits are atomic and can be reviewed independently. Happy to omit anything you don't want; just let me know. 🙂

zachdaniel commented 2 months ago

Love it. Definitely some weird habits I got into when learning Zipper that made its way into a lot of this code 😆 Awesome simplifications 🙇

Will merge once the build passes.

zachallaun commented 2 months ago

Looking into the Dialyzer error.

zachallaun commented 2 months ago

For posterity, the Dialyzer error was that this clause would never match because, if it got to that point, upwards.node would already be known to be a {:__block__, _, _} tuple (nil was checked earlier).

zachdaniel commented 2 months ago

🚀 Thank you for your contribution! 🚀