kennytm
kennytm
Also `.last()` doesn't return the very last value if you've called `.next_back()`. ```rust fn main() { let mut m = [1, 2, 3, 4, 5].iter(); m.next_back(); dbg!(m.last()); // Some(4) }...
You could clone the iterator to "remember the initial state". ```rust let mut m = [1, 2, 3, 4, 5].iter(); let m_original = m.clone(); m.next_back(); assert_eq!(m_original.last(), Some(&5)); ``` The `PeekableIterator`...
`ux`'s `u48` is backed by a `u64` (occupies 8 bytes), while what OP wants is likely a 6-byte type.
> Unless u48 would be less aligned than u32, it's going to be 8 bytes with padding regardless. Yes you could make it `[u16; 3]`. Additionally, being a `u64` means...
There's already an [intx](https://docs.rs/intx/latest/intx/) package that provides all 8N-bit integers (16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 128) with minimal storage and alignment...
@petrochenkov How difficult is it to make `#[repr]` a *non*-inert attribute, or at minimum separate `#[repr(u8, type = u8)]` as non-inert from the inert `#[repr(C, packed, align, simd, transparent)]`? Would...
@the8472 you don't need infinite precision, doing the computation in a higher precision than `f32`/`f64`/`f128` should be enough. But please don't make `fconst!` a compiler or std feature, there is...
One big reason why `TAU` was adapted (aside from the tau-manifesto) is that `2PI` is not a valid identifier, `PI_2` is wrong (easily mistaken as $\pi/2$), and `TWO_PI` is very...
it is already merged into libcore and tracked under https://github.com/rust-lang/rust/issues/103883#issuecomment-2839840002.
for your particular case you could simply use ```rust let fn_names = outbuf .split(|c| *c == 0x01) .map(|b| { // for simplicity i'm using .rsplit_once() here, but you could also...