const_sort_rs

Crates.ioconst_sort_rs
lib.rsconst_sort_rs
version0.3.4
sourcesrc
created_at2022-09-14 11:35:20.316327
updated_at2024-12-12 15:07:42.653915
descriptionSort slices in const items.
homepagehttps://github.com/ink-feather-org/const_sort_rs
repositoryhttps://github.com/ink-feather-org/const_sort_rs
max_upload_size
id665721
size81,818
Onestacked (onestacked)

documentation

README

const_sort_rs

docs.rs crates.io rustc

THIS CRATE IS BROKEN - Archive Note

The last tested working rust version is 1.71.0-nightly (nightly-2023-04-19). Most const traits have been removed from the standard library. Once they are back this crate might make a return if it is still needed.

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.

Commit count: 58

cargo fmt