Skip to content

Commit 0421dfd

Browse files
committed
Use vec macro instead of mut and push
Clippy emits: warning: calls to `push` immediately after creation As suggested, use `vec![]`.
1 parent 5155193 commit 0421dfd

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/policy/compiler.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -895,12 +895,12 @@ where
895895
};
896896

897897
let dissat_probs = |w: f64| -> Vec<Option<f64>> {
898-
let mut dissat_set = Vec::new();
899-
dissat_set.push(Some(dissat_prob.unwrap_or(0 as f64) + w * sat_prob));
900-
dissat_set.push(Some(w * sat_prob));
901-
dissat_set.push(dissat_prob);
902-
dissat_set.push(None);
903-
dissat_set
898+
vec![
899+
Some(dissat_prob.unwrap_or(0 as f64) + w * sat_prob),
900+
Some(w * sat_prob),
901+
dissat_prob,
902+
None,
903+
]
904904
};
905905

906906
let mut l_comp = vec![];

0 commit comments

Comments
 (0)