How to create a static array of strings?

前端 未结 4 1249
情书的邮戳
情书的邮戳 2021-02-03 18:45

Note This question contains syntax that predates Rust 1.0. The code is invalid, but the concepts are still relevant.

How do

4条回答
  •  悲&欢浪女
    2021-02-03 19:49

    This is a stable alternative for Rust 1.0 and every subsequent version:

    const BROWSERS: &'static [&'static str] = &["firefox", "chrome"];
    

提交回复
热议问题