Closed tokatoka closed 1 month ago
I don't think the extra dependency for nonzero_lit is worth it. It makes the code no more legible and is an extra dependency and extra macro.
unwrap() is more ugly.
The problem of returning error is that it is not helpful for most people. people won't see it unless they have errors_backtrace feature (and 90% people don't know that they even need to activate it to see the error)
If you just don't want dependency then i just copy paste these 9 lines into bolts
https://docs.rs/nonzero_lit/latest/src/nonzero_lit/lib.rs.html#170-179
The problem of returning error is that it is not helpful for most people. people won't see it unless they have errors_backtrace feature (and 90% people don't know that they even need to activate it to see the error)
The error will never trigger, why would anyone create a generator that generates 0 bytes? And then the error still is a meaningful error so they will see what's up even without backtrace
I don't think the extra dependency for nonzero_lit is worth it. It makes the code no more legible and is an extra dependency and extra macro.
unwrap() is more ugly.
It's the way the standard library does it, I didn't invent the language
Adapted the stuff
nonzero!
maybe using NonZero in the API isn't so ugly anymore?I'll leave the choice up to you, just wanted to voice my opinion one last time, do what you think is best ;)
0 size generator is odd but 0 stacking makes sense. because that stacking is about power
I have concerns with the changes:
nonzero_lit
is worth it. It makes the code no more legible and is an extra dependency and extra macro.