#ref #slice #go #opt

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
Download history 1295/week @ 2023-06-01 599/week @ 2023-06-08 1176/week @ 2023-06-15 1460/week @ 2023-06-22 1101/week @ 2023-06-29 1467/week @ 2023-07-06 1011/week @ 2023-07-13 1184/week @ 2023-07-20 1234/week @ 2023-07-27 1116/week @ 2023-08-03 1125/week @ 2023-08-10 1026/week @ 2023-08-17 893/week @ 2023-08-24 890/week @ 2023-08-31 1214/week @ 2023-09-07 842/week @ 2023-09-14

4,003 downloads per month
Used in 42 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