Hi! My favorite programming language is:
fn you_guessed_it() -> impl Debug {
..=..=.. .. .. .. .. .. .. .. .. .. .. .. .. ..
..=.. ..=.. .. .. .. .. .. .. .. .. .. ..=.. ..
..=.. ..=.. ..=.. ..=.. .. ..=..=.. ..=..=..=..
..=..=.. .. ..=.. ..=.. ..=.. .. .. .. ..=.. ..
..=.. ..=.. ..=.. ..=.. .. ..=.. .. .. ..=.. ..
..=.. ..=.. ..=.. ..=.. .. .. ..=.. .. ..=.. ..
..=.. ..=.. .. ..=..=.. ..=..=.. .. .. ..=..=..
}
My contributions to the Rust ecosystem.
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!")
collection-macro
which provides the general-purposeseq![]
andmap! {}
macros for creating collectionscommented
for commenting line in an unknown file typewrapping-in-range
lets you have stuff like.wrapping_sub
but for an integer in a custom range like1..=100
displaystr
provides a completely novel way to implement theDisplay
trait
Like Neofetch but for your country
It's a screenshot app written in Rust!
If you fork a project just to merge PRs you like, you might find patchy
useful
Incredibly simple dotfiles manager