Answers for "rust array literal"

0

rust array literal

fn boolean_to_string(b: bool) -> String {
     ["false", "true"][b as usize].to_string()
}
// Note how the array (the first []) is indexed (the second []).
Posted by: Guest on February-20-2021

Browse Popular Code Answers by Language