2 releases
0.1.1 | Sep 5, 2024 |
---|---|
0.1.0 | May 13, 2024 |
#715 in Rust patterns
89 downloads per month
7KB
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());