Answer the question
In order to leave comments, you need to log in
What does -> mean in Rust?
fn main(){
let message = get_message();
println!("message: {}", message);
}
fn get_message<'a>() -> &'a str {
"hello"
}
Answer the question
In order to leave comments, you need to log in
Rustbook: "Functions that return values" is just part of the syntax of rusty functions, which is used when you need to explicitly indicate the return type.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question