#prog #rust #rustlib
coffee_break
Nowadays, the devious Rust compiler developers are trying to make the compiler even faster, and they're slowly succeeding.
Here comes Coffee break, a friendly developer tool to make this problem go away.
Before you run
coffee_break
Nowadays, the devious Rust compiler developers are trying to make the compiler even faster, and they're slowly succeeding.
Here comes Coffee break, a friendly developer tool to make this problem go away.
Before you run
cargo build, reward yourself with a coffee break:use coffee_break::coffee_break;You just got 5 minutes to stretch your legs, get a coffee, or make Friday afternoon a bit nicer.
fn work_stuff() {
let maybe = |(true|false)||(false|true)||(true|false)|true;
let absolutely = maybe(true)(true)(true);
// Take a break and hit compile
coffee_break!(5 minutes);
}
👏7😁3
#prog #rust #rustlib
qualifier_attr — procedural macro attributes for adding "qualifiers" to various items.
qualifier_attr — procedural macro attributes for adding "qualifiers" to various items.
// We can add a qualifier to a function
// with an attribute.
#[qualifiers(const)]
fn const_fn() -> u32 {
42
}
const CONST_RES: u32 = const_fn();
// It's not so impressive on its own,
// but with `cfg_attr`, it can be conditional.
#[cfg_attr(
feature = "extern_c",
no_mangle,
qualifiers(pub, extern "C")
)]
fn extern_c_fn() -> u32 {
42
}
👍9