nik-rev - Overview

Hi! My favorite programming language is:

fn you_guessed_it() -> impl Debug {
    ..=..=.. ..    .. .. .. ..    .. .. .. ..    .. .. .. ..
    ..=.. ..=..    .. .. .. ..    .. .. .. ..    .. ..=.. ..
    ..=.. ..=..    ..=.. ..=..    .. ..=..=..    ..=..=..=..
    ..=..=.. ..    ..=.. ..=..    ..=.. .. ..    .. ..=.. ..
    ..=.. ..=..    ..=.. ..=..    .. ..=.. ..    .. ..=.. ..
    ..=.. ..=..    ..=.. ..=..    .. .. ..=..    .. ..=.. ..
    ..=.. ..=..    .. ..=..=..    ..=..=.. ..    .. ..=..=..
}

here are some of my stuffs:

derive_aliases github

Custom #[derive] aliases. Write this:

#[derive(Debug, ..Ord, ..Copy)]
//              ^^^^^^^^^^^^^
//              aliases
struct User;

which expands to this:

#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Copy, Clone)]
//             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
//             expanded
struct User;

docstr github

Ergonomic multi-line string literals, even composes with any macro like format!.

use docstr::docstr;

let hello_world_in_c: &'static str = docstr!(
    /// #include <stdio.h>
    ///
    /// int main(int argc, char **argv) {
    ///     printf("hello world\n");
    ///     return 0;
    /// }
);

assert_eq!(hello_world_in_c, r#"#include <stdio.h>

int main(int argc, char **argv) {
    printf("hello world\n");
    return 0;
}"#)

culit github

Lets you define custom literals. Like literals for Duration:

#[culit]
fn main() {
    assert_eq!(
        100d + 11h + 8m + 7s,
        Duration::from_secs(100 * 60 * 60 * 24)
        + Duration::from_secs(11 * 60 * 60)
        + Duration::from_secs(8 * 60)
        + Duration::from_secs(7)
    );
}

Fully custom, can be whatever you want. Like 10nzusize which produces NonZeroUsize and compile errors if it is 0.

simply_colored github

Simplest crate in existence for terminal styles.

use simply_colored::*;

println!("{BLUE}{BOLD}Simply colored!")

countryfetch github

Like Neofetch but for your country