arrayref
arrayref copied to clipboard
Two macros for taking array references in rust.
I got some test failures when building this with Guix: ``` starting phase `check' running 10 tests test test::test_5_array_refs ... ok test test::simple_case_works ... ok test test::test_5_array_refs_dotdot ... ok test...
I wonder if you would be open to a PR that allowed for most slice syntax, or have any thoughts on whether this is a good or bad idea. A...
It is now possible to implement this macro safely thanks to TryInto implementation from slices to array references: ```rust let my_arr_reference: &[i32; 5] = my_slice.try_into().unwrap(); ``` Bounds checks will also...
For whatever reason when I use `array_ref!()` and then look at the generated assembly, I can see the compiler for whatever reason is not able to elude the bounds checking...
Currently `array_ref!` takes a slice this way: let slice = & $arr[offset..offset + $len]; If the length of `slice` is already known, the compiler should be able to skip bounds...
These are wrappers for combinations of `slice::split_at` or `slice::split_at_mut` with `array_ref` and `array_mut_ref` respectively, that simplify handling a variety of references into a slice. In essence, they use a call...
unsafe is no longer needed here since this is now supported in stable rust, the panic behavior is the same as before since it would panic anyways if the slice...
The old link was broken