Hi! My favorite programming language is:
fn you_guessed_it() -> impl Debug { ..=..=.. .. .. .. .. .. .. .. .. .. .. .. .. .. ..=.. ..=.. .. .. .. .. .. .. .. .. .. ..=.. .. ..=.. ..=.. ..=.. ..=.. .. ..=..=.. ..=..=..=.. ..=..=.. .. ..=.. ..=.. ..=.. .. .. .. ..=.. .. ..=.. ..=.. ..=.. ..=.. .. ..=.. .. .. ..=.. .. ..=.. ..=.. ..=.. ..=.. .. .. ..=.. .. ..=.. .. ..=.. ..=.. .. ..=..=.. ..=..=.. .. .. ..=..=.. }
here are some of my stuffs:
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;
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; }"#)
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.
Simplest crate in existence for terminal styles.
use simply_colored::*; println!("{BLUE}{BOLD}Simply colored!")
Like Neofetch but for your country