Skip to content

Commit

Permalink
run clippy in coulombs law
Browse files Browse the repository at this point in the history
  • Loading branch information
alirezasariri78 committed Nov 8, 2024
1 parent f907fea commit ce72ad3
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/electronics/coulombs_law.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,11 @@ pub fn coulombs_law(
"charge2: {}",
calculate_charge(charge1, force, distance)
));
} else {
return Ok(format!(
"distance: {}",
calculate_distance(charge_product, force)
));
}
Ok(format!(
"distance: {}",
calculate_distance(charge_product, force)
))
}
fn calculate_distance(charge_product: f64, force: f64) -> f64 {
(COULOMBS_CONSTANT * charge_product / force.abs()).sqrt()
Expand Down

0 comments on commit ce72ad3

Please sign in to comment.