|
|
|
|
|
by koito17
205 days ago
|
|
> I don't think I've ever seen a crate or production codebase that documents infallibility of every single slice access. The smoltcp crate typically uses runtime checks to ensure slice accesses made by the library do not cause a panic. It's not exactly equivalent to GP's assertion, since it doesn't cover "every single slice access", but it at least covers slice accesses triggered by the library's public API. (i.e. none of the public API functions should cause a panic, assuming that the runtime validation after the most recent mutation succeeds). Example: https://docs.rs/smoltcp/latest/src/smoltcp/wire/ipv4.rs.html... |
|