Function hello_world_x_rust_x_library::greet [] [src]

pub fn greet(name: Option<&str>) -> String

This function takes an optional name and returns a greeting

Examples

If no name is given, it will return the default greeting

use hello_world_x_rust_x_library::greet;

assert_eq!("Hello, world!", greet(None));

If a name is given, it will return a customized greeting

use hello_world_x_rust_x_library::greet;

assert_eq!("Hello, intrepion!", greet(Some("intrepion")));