| Crates.io | wikisort |
| lib.rs | wikisort |
| version | 1.0.0 |
| created_at | 2025-08-24 15:18:23.324415+00 |
| updated_at | 2025-08-24 15:18:23.324415+00 |
| description | Wikisort ported to Rust |
| homepage | |
| repository | https://github.com/H4n-uL/wikisort-rs |
| max_upload_size | |
| id | 1808500 |
| size | 61,637 |
I have no allocator, and I must do stable sort, in O(n log n).
- wikisort, maybe.
Fuck-your-allocator sorting al gore rhythm from a bloody-fucking-hellfire
don't even try to think to ask me how i implemented this, i'm in therapy.
Licence? I was about to release it in public domain even if the og was GPLv69 but the og is Unlicense yay
don't, this cursed al gore rhythm will destroy you(except comments or assertion failure or CVE)
I wanted to implement Grailsort at first but check this out
cargo add wikisort
use wikisort::*;
use core::cmp::Ordering;
// if you want to use it like a slice.sort();
trait Wikisort<T> {
fn wikisort(&mut self) where T: Ord;
fn wikisort_by<F>(&mut self, cmp: F) where F: Fn(&T, &T) -> Ordering;
fn wikisort_by_key<F, K>(&mut self, f: F) where F: Fn(&T) -> K, K: Ord;
}
impl<T> Wikisort<T> for Vec<T> {
fn wikisort(&mut self) where T: Ord {
wikisort(self, |a, b| a.cmp(b));
}
fn wikisort_by<F>(&mut self, cmp: F) where F: Fn(&T, &T) -> Ordering {
wikisort(self, cmp);
}
fn wikisort_by_key<F, K>(&mut self, f: F) where F: Fn(&T) -> K, K: Ord {
wikisort(self, |a, b| f(a).cmp(&f(b)));
}
}
fn main() {
// ... fuck around with the data vector ...
let mut data = vec![5, 2, 8, 1, 9, 3, 7, 4, 6, 0];
data.wikisort();
assert!(data.is_sorted()); // yes warranty, in my blood
}
fuck you