tisonkun commented on issue #27: URL: https://github.com/apache/datasketches-rust/issues/27#issuecomment-3665812881
That is, code like `NonZeroUsize::new(1).unwrap()` should be acceptable. Nothing is expected to happen on the `None` variant because it won't happen. Actually, when you're using Rust's stdlib, there are already many `assert!` inside (`a[idx]` would panic if index out of bound). Crates like [nonempty-collections](https://github.com/fosskers/nonempty-collections) hide the assert/unwrap for you because it keeps the contracts internally. If they can write sound code with assertions to check invariants, we should be able to do that as well. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
