Skip to content

Commit

Permalink
move collections to the end
Browse files Browse the repository at this point in the history
I could see an argument for the collection being moved to the front as well. But I think either is a better case than in the middle.

I chose the end here because I think it reads easier when testing to have the function, then small decision making structs, _then_ the collection that could be constructed in place.
  • Loading branch information
michaeldjeffrey committed Jun 12, 2024
1 parent 87b6b3a commit 0399213
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions coverage_point_calculator/src/hexes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ pub struct CoveredHex {

pub(crate) fn clean_covered_hexes(
radio_type: RadioType,
ranked_coverage: Vec<RankedCoverage>,
boosted_hex_status: BoostedHexStatus,
ranked_coverage: Vec<RankedCoverage>,
) -> Result<Vec<CoveredHex>> {
// verify all hexes can obtain a base coverage point
let covered_hexes = ranked_coverage
Expand Down Expand Up @@ -116,8 +116,8 @@ mod tests {

let covered_hexes = clean_covered_hexes(
RadioType::IndoorWifi,
vec![unboosted_coverage, boosted_coverage],
boost_status,
vec![unboosted_coverage, boosted_coverage],
)
.unwrap();

Expand Down
2 changes: 1 addition & 1 deletion coverage_point_calculator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ impl CoveragePoints {
BoostedHexStatus::new(&radio_type, location_trust_multiplier, &radio_threshold);

let covered_hexes =
hexes::clean_covered_hexes(radio_type, ranked_coverage, boost_eligibility)?;
hexes::clean_covered_hexes(radio_type, boost_eligibility, ranked_coverage)?;
let hex_coverage_points = hexes::calculated_coverage_points(&covered_hexes);

let speedtests = speedtest::clean_speedtests(speedtests);
Expand Down

0 comments on commit 0399213

Please sign in to comment.