#slice #length #reference #turn

ref_slice

Turn a reference into a slice of length one

6 releases (stable)

Uses old Rust 2015

1.2.1 Apr 29, 2021
1.2.0 Sep 29, 2019
1.1.1 Nov 3, 2016
1.1.0 Sep 2, 2016
0.1.0 Oct 23, 2015

#66 in #turn

Download history 1039/week @ 2023-11-27 1301/week @ 2023-12-04 2383/week @ 2023-12-11 1065/week @ 2023-12-18 606/week @ 2023-12-25 1290/week @ 2024-01-01 3337/week @ 2024-01-08 2060/week @ 2024-01-15 2815/week @ 2024-01-22 2632/week @ 2024-01-29 2390/week @ 2024-02-05 2153/week @ 2024-02-12 1995/week @ 2024-02-19 2549/week @ 2024-02-26 2961/week @ 2024-03-04 817/week @ 2024-03-11

8,494 downloads per month
Used in 43 crates (9 directly)

Apache-2.0/MIT

5KB
76 lines

ref_slice

Documentation Crates.io

Small utility functions for getting slices of length one.

This used to be in the standard library, but was removed. So here you go!

There are also versions that work on Option<T> as well.

No runtime deps