Daily Shaarli

All links of one day in a single page.

September 5, 2024

Reasonable Colors

Reasonable Colors is an open-source color system for building accessible, nice-looking color palettes.

Don't Unwrap Options: There Are Better Ways | corrode Rust Consulting

Since Rust 1.65:

let Some(user) = get_user() else {
    return Err("No user".into());
};

The option can also be handled with .ok_or() if it's recoverable.

The last solution is to use the match statement.