#world #status #workflow

bin+lib hello-world-in-rust

Hello World!

2 releases

0.1.1 Sep 5, 2024
0.1.0 May 13, 2024

#679 in Rust patterns

41 downloads per month

MIT license

7KB

version workflow status codecov status

Hello World

Hello world in Rust!

Run the binary:

hello-world-in-rust
# Output: hello world!

Execute as crate:

let next_word = hello_world::hello();

Hello World Derive

Add macro to print out the hello world message in a function.

#[hello_world]
fn main {
    // The macro will generate println! to print the hello world message here.
}

lib.rs:

Provides a function hello() that returns the word "world!".

Example

let what = hello_world::hello();
assert_eq!(what, "world!".to_string());

No runtime deps