In Kotlin, we can write:
fun greet(person: String): Unit {
println("Hello, $person")
}
In Swift, we can write:
func greet(person: String) {
println("Hello, \(person)!")
}
In Julia, we can write:
function greet(person::String)
println("Hello, $person")
end
In Rust, we can write:
fn greet(person: &str) {
println!("Hello, {}", person)
}
Is there a way in Rust to make the println
looks something like the one in Kotlin or Swift, i.e. replacing the "{}", person
by something like {person}
or \(person)