Skip to content

Commit 3f7dff9

Browse files
committed
refactor: Simplify default_labels function to use HashMap::from
- Replace the manual creation of a HashMap in the default_labels function with a more concise HashMap::from method. - Update the default labels to include specific keys for blackbox project, environment, and instance.
1 parent dc8fc81 commit 3f7dff9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/config.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ pub struct Target {
2020
}
2121

2222
fn default_labels() -> HashMap<String, String> {
23-
let mut labels = HashMap::new();
24-
labels.insert("default".to_string(), "true".to_string());
25-
labels
23+
HashMap::from([
24+
("blackbox/project".to_string(), "default".to_string()),
25+
("blackbox/env".to_string(), "default".to_string()),
26+
("blackbox/instance".to_string(), "default".to_string()),
27+
])
2628
}
2729

2830
#[derive(Serialize, Deserialize, Debug, Clone)]

0 commit comments

Comments
 (0)