Skip to content

Instantly share code, notes, and snippets.

View nrc's full-sized avatar
🐙

Nick Cameron nrc

🐙
View GitHub Profile
WARNING: documentation for this crate may be rendered differently using the new Pulldown renderer.
See https://github.com/rust-lang/rust/issues/44229 for details.
WARNING: rendering difference in `Constructs a `Layout` from a given `size` and `align`,...`
--> src/liballoc/allocator.rs:79:4
/html[0]/body[1]/ul[1]/li[1]/p[0] Text differs:
expected: `must not exceed 2^31 (i.e.`
found: `must not exceed 2`
/html[0]/body[1]/ul[1]/li[1]/p[0] Tags differ: expected: `code`, found: `sup`
/html[0]/body[1]/ul[1]/li[1]/p[0] Text differs:
expected: `),`
@nrc
nrc / async.rs
Created September 7, 2022 12:56
async IO traits
use std::io::Result;
use std::mem::{self, MaybeUninit};
// A simple async-ification of sync Read plus downcasting methods.
pub trait Read {
// async
fn read(&mut self, buf: &mut [u8]) -> Result<usize>;
// ...
@nrc
nrc / main.rs
Created December 3, 2024 21:43
Advent of Code 2024 day 3
#![allow(internal_features)]
#![feature(duration_millis_float)]
#![feature(core_intrinsics)]
use std::time::Instant;
use std::intrinsics::{select_unpredictable, unlikely};
#[global_allocator]
static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;