6 releases

Uses new Rust 2021

new 0.3.2 Sep 29, 2022
0.3.1 Sep 25, 2022
0.2.1 Sep 22, 2022
0.1.0 Sep 14, 2022

#335 in Rust patterns

Download history 8/week @ 2022-09-08 35/week @ 2022-09-15 74/week @ 2022-09-22

117 downloads per month
Used in trait_cast_rs

MIT/Apache

72KB
1K SLoC

const_sort_rs

Daily-Nightly Rust-Main-CI docs.rs crates.io rustc

Requirements

This crate requires a nightly compiler.

What can this crate do?

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.

Example

#![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])

Authors

raldone01 and onestacked are the primary authors and maintainers of this library.

License

This project is released under either:

at your choosing.

Contribution

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.

Dependencies