I hereby claim:
- I am dutchghost on github.
- I am dutch_gh0st (https://keybase.io/dutch_gh0st) on keybase.
- I have a public key ASAwDqevj5i8sQ7FdR3wH7lTOZrWKhSXNeN6Zxb_7UE-Vgo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
#![feature(exact_chunks)] | |
const POW10_U64: [u64; 20] = [ | |
10_000_000_000_000_000_000, | |
1_000_000_000_000_000_000, | |
100_000_000_000_000_000, | |
10_000_000_000_000_000, | |
1_000_000_000_000_000, | |
100_000_000_000_000, | |
10_000_000_000_000, |
use std::cell::RefCell; | |
trait Defer { | |
fn call(self: Box<Self>); | |
} | |
impl<F: FnOnce(T), T> Defer for (F, T) { | |
fn call(self: Box<Self>) { | |
(self.0)(self.1); | |
} |
use crate::{ | |
container::container::{Container, scope}, | |
fundemental::{range::Range, proof::NonEmpty, index::Index}, | |
}; | |
pub fn qsort<T: Ord>(slice: &mut [T]) { | |
scope(slice, |mut v| { | |
if let Ok(range) = v.range().nonempty() { | |
quicksort(&mut v, range); | |
} |
#![feature(nll)] | |
use std::marker::PhantomData; | |
// Can't make it longer or shorter | |
#[derive(Copy, Clone)] | |
struct Invariant<'id>(PhantomData<*mut &'id ()>); | |
impl<'id> Invariant<'id> { | |
pub const fn new() -> Self { |
use std::marker::PhantomData; | |
use std::ops::{Deref, DerefMut}; | |
/// Fake stdlib's TraitObject: | |
/// https://doc.rust-lang.org/std/raw/struct.TraitObject.html | |
/// That requires nightly, but this works on stable. | |
#[derive(Copy, Clone)] | |
#[repr(C)] | |
struct TraitObject { | |
_data: *mut (), |
#![allow(dead_code, unused_variables)] | |
#![feature(const_generics)] | |
pub type uinfo = u32; | |
pub struct Debug<T, const LINE: uinfo, const COLUMN: uinfo> { | |
pub inner: T, | |
} | |
impl <T, const LINE: uinfo, const COLUMN: uinfo> Debug<T, {LINE}, {COLUMN}> { |
#![feature(const_generics)] | |
struct Range { | |
start: usize, | |
end: usize, | |
} | |
impl Range { | |
pub const fn new(start: usize, end: usize) -> Self { | |
Self { start, end } |
#![no_std] | |
#[inline] | |
pub const unsafe fn fake_type<T>() -> T { | |
hint_unreachable() | |
} | |
#[inline] | |
pub const unsafe fn hint_unreachable() -> ! { | |
fake_type() | |
} |