Jump to content

Main public logs

Combined display of all available logs of JOHNWICK. You can narrow down the view by selecting a log type, the username (case-sensitive), or the affected page (also case-sensitive).

Logs
  • 07:27, 16 November 2025 PC talk contribs created page How to Get a Slice as an Array in Rust (Without Losing Your Mind) (Created page with "You have an array or slice in Rust.
You know it definitely has (at least) three elements.
You want a nice, clean [u8; 3] out of it. So you try this: fn pop(barry: &[u8]) -> [u8; 3] { barry[0..3] // expected array `[u8; 3]`, found slice `[u8]` } …and the compiler gently tells you: expected array [u8; 3], found slice [u8] What’s going on, and how do you fix it in a clean, idiomatic way? Let’s walk through it step by step. Slices vs Arrays: Why the Co...")