Because it can be done for multiple lines too. And you can do else-if too. Also, “if” and “else” is more recognizable than “?” and “:”
x = if y > 5 {
println!("Y was over 5");
z + 5
} else if y < 0 {
handle_negative_y(y);
z - y
} else {
println!("<WARN> unexpected value for y"}
0
}
Sha256 is a hashing algorithm. Not a public/private key algorithm.