start to convert ad-hoc errors to explicit types #30

Merged
ashkitten merged 1 commits from explicit-error-type into dev 2024-12-30 20:48:15 -05:00
ashkitten commented 2024-12-30 15:35:28 -05:00 (Migrated from github.com)

i only explicitly converted the string errors in nodes/mod.rs since that was the performance issue pointed out originally, but i ended up having to convert the return type of everything to match, even though eyre! is used elsewhere. i made our own version of the bail! and ensure! macros that returns our type for compatibility. as we go we can convert more eyre! invocations and such into explicit types as needed.

i only explicitly converted the string errors in `nodes/mod.rs` since that was the performance issue pointed out originally, but i ended up having to convert the return type of everything to match, even though `eyre!` is used elsewhere. i made our own version of the `bail!` and `ensure!` macros that returns our type for compatibility. as we go we can convert more `eyre!` invocations and such into explicit types as needed.
technobaboo (Migrated from github.com) requested changes 2024-12-30 15:48:22 -05:00
technobaboo (Migrated from github.com) left a comment

could you make it so the error type is in a use statement for each file instead of prepended? makes the code a ton neater... and you can rename the error type. Also a typedef for a result with that error would be even neater! could import that instead!

could you make it so the error type is in a `use` statement for each file instead of prepended? makes the code a ton neater... and you can rename the error type. Also a typedef for a result with that error would be even neater! could import that instead!
ashkitten commented 2024-12-30 16:25:30 -05:00 (Migrated from github.com)

@technobaboo i'm not sure what you mean by "instead of prepended" but i did the other things.

@technobaboo i'm not sure what you mean by "instead of prepended" but i did the other things.
technobaboo (Migrated from github.com) approved these changes 2024-12-30 17:33:15 -05:00
Sign in to join this conversation.