This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[package] | |
name = "fizzbuzz" | |
version = "0.1.0" | |
edition = "2021" | |
[features] | |
use_nightly = [] | |
compare_with_previous_impl = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum Expr { | |
Lit(i32), | |
Neg(Box<Self>), | |
Add(Box<Self>, Box<Self>), | |
} | |
fn lit(x: i32) -> Expr { | |
Expr::Lit(x) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstddef> | |
#include <cstring> | |
#include <cstdlib> | |
// #define TYPED_TIGHT_MALLOC | |
namespace typed { | |
template <typename T> | |
T* memset_n(T *dest, int ch, std::size_t count) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[derive(Clone, Copy)] | |
pub struct Bounds { | |
rows: usize, | |
cols: usize, | |
} | |
type Pos = (usize, usize); | |
impl Bounds { | |
pub fn around_neumann( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![feature(generic_associated_types)] | |
pub struct Data { | |
pub name: String, | |
pub whatever: u32, | |
pub bytes: Vec<u8>, | |
} | |
trait BorrowedKeyFamily { | |
type Key<'a>: Ord + 'a; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::cmp::Ordering; | |
use std::convert::Infallible as Never; | |
use std::fmt::{self, Debug}; | |
struct Z; | |
struct S<T>(T); | |
#[derive(Clone)] | |
struct Node<T, Next> { | |
value: T, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Lexer<'a> { | |
s: &'a str, | |
} | |
type Num = usize; | |
#[derive(Debug)] | |
enum Lexeme<'a> { | |
String(&'a str), | |
Num(Num), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct HNil; | |
struct HCons<H, T> { | |
head: H, | |
tail: T, | |
} | |
#[cfg(feature = "")] | |
mod via_debug_vec { | |
use super::{HCons, HNil}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait Provide<Item, Path> { | |
fn provide(&mut self) -> Item; | |
} | |
struct Itself; | |
struct Head<T>(T); | |
struct Tail<T>(T); | |
struct HNil; | |
struct HCons<H, T>(H, T); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use hashbrown::HashMap; | |
use std::{ | |
borrow::Borrow, | |
hash::{BuildHasher, Hash, Hasher}, | |
sync::{Mutex, MutexGuard, PoisonError}, | |
}; | |
pub struct LockedHashMap<K, V, S> { | |
inner: Mutex<HashMap<K, V, S>>, |
NewerOlder