📜  rust 数组文字 - Rust 代码示例

📅  最后修改于: 2022-03-11 14:49:24.950000             🧑  作者: Mango

代码示例1
fn boolean_to_string(b: bool) -> String {
     ["false", "true"][b as usize].to_string()
}
// Note how the array (the first []) is indexed (the second []).