compile_time_sort
This crate provides functions for sorting arrays and slices of primitives in const contexts.
Arrays and slices of bools, u8s, and i8s are sorted with counting sort while arrays of other types
are sorted with quicksort.
Functions with the naming convention into_sorted_*_array take an array by value,
and functions with the naming convention sort_*_slice take a mutable reference to a slice.
Examples
Sort an array by value:
use into_sorted_i32_array;
const ARRAY: = ;
const SORTED_ARRAY: = into_sorted_i32_array;
assert_eq!;
Sort an array by reference:
use sort_i32_slice;
const SORTED_ARRAY: = ;
assert_eq!;
Features
sort_slices: enables the sort_*_slice functions and raises the MSRV of the crate to 1.83.0.