In Rust, the unit type ()
is a type that has exactly one value, also written as ()
. It is used to indicate the absence of a meaningful value and is often seen in functions that do not return a value.
In this challenge, you will implement a function that prints a message and returns the unit type.
You need to implement the function print_message() -> ()
that prints "Hello, Rust!"
to the console and returns the unit type.
print_message
function should print "Hello, Rust!"
to the console.()
.let result = print_message();
assert_eq!(result, ());
pub fn print_message() -> () { // TODO: Implement the function here println!("Hello, Rust!"); ()}
pub fn print_message() -> () { // TODO: Implement the function here ()}
pub fn print_message() -> () { // TODO: Implement the function here println!("Hello, Rust!");}
pub fn print_message() -> () { // TODO: Implement the function here println!("Hello, Rust!"); return ();}
pub fn print_message() -> () { // TODO: Implement the function here println!("Hello, Rust!")}
pub fn print_message() -> () { // TODO: Implement the function here println!("Hello, Rust!"); return ();}
pub fn print_message() { println!("Hello, Rust!"); // The unit type is used in rust to return a void/none value (no value) // If a function has no return type in its signature it returns the unit // type by default. For this reason this simple implementation works.}
pub fn print_message() -> () { // TODO: Implement the function here println!("Hello, Rust!"); ()}
pub fn print_message() -> () { println!("Hello, Rust!"); ()}
pub fn print_message() -> () { println!("Hello, Rust!")}
pub fn print_message() -> () { // TODO: Implement the function here println!("Hello, Rust!")}
pub fn print_message() -> () { println!("Hello, Rust!")}
pub fn print_message() -> () { // TODO: Implement the function here println!("Hello, Rust!");}
pub fn print_message() -> () { // TODO: Implement the function here println!("Hello, Rust!")}
pub fn print_message() -> () { // TODO: Implement the function here println!("Hello, Rust!")}
pub fn print_message() -> () { // TODO: Implement the function here println!("Hello, Rust!");}
pub fn print_message() -> () { // TODO: Implement the function here println!("Hello, Rust!");}
pub fn print_message() -> () { println!("Hello, Rust!"); ()}
pub fn print_message() -> () { // TODO: Implement the function here println!("Hellom Rust"); return();}
pub fn print_message() -> () { // TODO: Implement the function here println!("Hello, Rust!")}
pub fn print_message() -> () { println!("hello, Rust!"); return ();}
pub fn print_message() -> () { println!("hello, Rust!");}
pub fn print_message() -> () { // TODO: Implement the function here println!("Hello, Rust!")}
pub fn print_message() -> () { // TODO: Implement the function here println!("Hello, Rust!"); return ()}
pub fn print_message() -> () { // TODO: Implement the function here println!("Hello, Rust!")}
pub fn print_message() -> () { // TODO: Implement the function here ()}
pub fn print_message() -> () { println!("Hello, Rust!"); return ()}
pub fn print_message() -> () { // TODO: Implement the function here println!("Hello, Rust!")}
pub fn print_message() -> () { // TODO: Implement the function here println!("Hello, Rust!:");}
pub fn print_message() -> () { println!("Hello, Rust!") // TODO: Implement the function here}
pub fn print_message() -> () { // TODO: Implement the function here println!(" "); ()}
pub fn print_message() -> () { // TODO: Implement the function here println!("Hello, Rust!");}
pub fn print_message() -> () { // TODO: Implement the function here println!("Hello, Rust!");}
pub fn print_message() -> () { // TODO: Implement the function here println!("Hello, Rust!"); return ();}
pub fn print_message() -> () { // TODO: Implement the function here ("Hello, Rust!");}
pub fn print_message() -> () { // TODO: Implement the function here print!("Hello, Rust!")}
pub fn print_message() -> () { // TODO: Implement the function here println!("Hello, Rust!"); ()}
pub fn print_message() -> () { // TODO: Implement the function here println!("Hello, Rust!");}
pub fn print_message() -> () { // TODO: Implement the function here println!("Hello, Rust!"); ()}
pub fn print_message() -> () { // TODO: Implement the function here println!("Hello, Rust!")}
pub fn print_message() -> () { // TODO: Implement the function here println!("Hello, Rust!") }
pub fn print_message() -> () { // TODO: Implement the function here println!("Hello, Rust!"); ()}
pub fn print_message() -> () { println!("Hello, Rust!"); ()}
pub fn print_message() -> () { // TODO: Implement the function here println!("Hello, Rust!");}
pub fn print_message() -> () { println!("Hello, Rust!")}
pub fn print_message() -> () { // TODO: Implement the function here println!("Hello, Rust!")}
pub fn print_message() -> () { println!("Hello, Rust!")}
pub fn print_message() -> () { // TODO: Implement the function here println!("Hello, Rust!"); return ();}
pub fn print_message() -> () { // TODO: Implement the function here}
pub fn print_message() -> () { // TODO: Implement the function here ()}