Sergey "Shnatsel" Davidoff

Results 943 comments of Sergey "Shnatsel" Davidoff

Oh, another one! There are also: - https://crates.io/crates/buffer - https://crates.io/crates/uninit - https://crates.io/crates/static-alloc

Another use case for fixed-capacity Vec-like memory view - flate2 needs it to become 100% safe. See #32

Regarding the "fixed-capacity Vec" approach: `tokio` is working on an AsyncRead trait that writes to a Vec-like structure instead of a slice. This lets us sidestep the thorny issues around...

As someone who has raised the topic of an improved `Read` trait before, I can already tell this is going to be a long discussion due to the sheer size...

Yeah, currently it's not really clear what do about things we could not convert to safe code. We should probably set up a file in the repo to document such...

We can usually make safe abstractions that remove that overhead. It's just that for some use cases they're currently missing; see the Read trait requiring either an unbounded Vec to...

Item shadowing is a double-edged sword. Intentional use for removing variables you don't want to use accidentally is great. On the other hand, accidental shadowing may cause issues. I don't...

If you're converting from `&[u8]` instead of `[u8; 8]` you also need TryFrom, which has MSRV of 1.34

The `copy_from_slice` approach can be fiddly, sometimes rustc doesn't optimize equivalent-looking code properly: https://godbolt.org/z/jmac5x

Yes, rustc bug: https://github.com/rust-lang/rust/issues/70439