-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Hi, thanks for writing this library, I've been using it without issues on the 915MHz band.
I wanted to ask about the use of &'static str as the main error type. It makes it difficult to match on specific errors because the user doesn't know what errors actually exist without wading through the library source code, and on no-std targets the strings are baked in even if they don't need to be printed, which inflates the size of the binary.
Compare this to an error enum that implements Debug, which is both much easier to match against but also the error strings are only included if the errors are actually printed (if they are unwrapped, for instance). I quickly threw together and tested a version of this library with enums and this reduced the size of the library by 20-30% (in my project the library accounted for 2-3kB of program memory, and the enum version was ~600B smaller). On my 32kB microcontroller this was very noticeable.
I'm happy to write a PR for this as I've been playing around with some error handling implementations already, so if you're willing we could discuss specifics.