Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
iancleary committed Jun 6, 2024
1 parent 91a1f62 commit db14c12
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 13 deletions.
10 changes: 3 additions & 7 deletions src/budget.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,8 @@ impl LinkBudget {

// Assumes receiver input power is spread across the bandwidth

let pin_at_receiver = self.transmitter.output_power + self.transmitter.gain
- free_space_path_loss
- self.rain_fade
+ self.receiver.gain;

pin_at_receiver
// pin_at_receiver =
self.transmitter.output_power + self.transmitter.gain - free_space_path_loss - self.rain_fade + self.receiver.gain
}
pub fn snr(&self) -> f64 {
// returns value in dB
Expand All @@ -60,7 +56,7 @@ impl LinkBudget {
}

pub fn print(&self) {
print_title(&self.name);
print_title(self.name);
print_row("Summary", "Value", "Unit");
print_header();
print_row("Frequency", &self.frequency.to_string(), "Hz");
Expand Down
2 changes: 1 addition & 1 deletion src/conversions/power.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ mod tests {
#[test]
fn dbm_to_watts() {
// not worrying about floating point precision here
let dbm: f64 = 43.0102999566398087;
let dbm: f64 = 43.010_299_956_639_805;

let watts: f64 = super::dbm_to_watts(dbm);

Expand Down
5 changes: 2 additions & 3 deletions src/fspl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,11 @@ pub struct SlantRange {

impl SlantRange {
pub fn calculate(&self) -> f64 {
let slant_range = calculate_slant_range(
calculate_slant_range(
self.elevation_angle_degrees,
self.altitude,
crate::constants::RADIUS_OF_EARTH,
);
slant_range
)
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/utils/print.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ pub fn print_header() {
pub fn print_separator() {
// println!("");
println!("--------------------------------------------------");
println!("");
println!();
}

#[allow(dead_code)]
pub fn print_title(title: &str) {
println!(" {}", title);
println!("--------------------------------------------------");
println!("");
println!();
}

0 comments on commit db14c12

Please sign in to comment.