Crates.io | const_sort_rs |
lib.rs | const_sort_rs |
version | 0.3.3 |
source | src |
created_at | 2022-09-14 11:35:20.316327 |
updated_at | 2022-11-10 08:32:19.598183 |
description | Sort slices in const items. |
homepage | https://github.com/ink-feather-org/const_sort_rs |
repository | https://github.com/ink-feather-org/const_sort_rs |
max_upload_size | |
id | 665721 |
size | 83,761 |
This crate requires a nightly compiler.
This crate implements the sort_unstable*
functions and as a bonus exposes a const version of sort_internals
.
Check out the ConstSliceSortExt
trait to see all available functions and const examples.
Your types must implement ~const PartialOrd
.
#![feature(const_mut_refs)]
#![feature(const_trait_impl)]
use const_sort_rs::ConstSliceSortExt;
const V: [isize; 5] = {
let mut x = [-5, 4, 1, -3, 2];
x.const_sort_unstable();
x
};
assert_eq!(V, [-5, -3, 1, 2, 4])
raldone01 and onestacked are the primary authors and maintainers of this library.
This project is released under either:
at your choosing.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.