We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cfd89ac commit a203105Copy full SHA for a203105
README.md
@@ -43,7 +43,7 @@ use lazy_static::lazy_static;
43
use std::collections::HashMap;
44
45
lazy_static! {
46
- static ref HASHMAP: HashMap<u32, &str> = {
+ static ref HASHMAP: HashMap<u32, &'static str> = {
47
let mut m = HashMap::new();
48
m.insert(0, "foo");
49
m.insert(1, "bar");
@@ -70,7 +70,7 @@ use std::collections::HashMap;
70
use std::sync::OnceLock;
71
72
fn hashmap() -> &'static HashMap<u32, &'static str> {
73
- static HASHMAP: OnceLock<HashMap<u32, &'static str>> = OnceLock::new();
+ static HASHMAP: OnceLock<HashMap<u32, &str>> = OnceLock::new();
74
HASHMAP.get_or_init(|| {
75
76
0 commit comments