From 38317de40d74b5370282b02c9d2f19b870d4ff3a Mon Sep 17 00:00:00 2001 From: Bill Thiede Date: Sun, 13 Oct 2019 07:55:06 -0700 Subject: [PATCH] Cleanup lint in human. --- rtiow/src/human.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/rtiow/src/human.rs b/rtiow/src/human.rs index bfe6fe8..011705b 100644 --- a/rtiow/src/human.rs +++ b/rtiow/src/human.rs @@ -1,3 +1,4 @@ +#![allow(dead_code)] #![doc(html_root_url = "https://docs.rs/human_format")] //! From https://raw.githubusercontent.com/BobGneu/human-format-rs/master/src/lib.rs @@ -72,7 +73,7 @@ impl Formatter { Formatter { decimals: 2, separator: " ".to_owned(), - scales: Scales::SI(), + scales: Scales::si(), forced_units: "".to_owned(), forced_suffix: "".to_owned(), } @@ -151,11 +152,11 @@ impl Formatter { impl Scales { /// Instantiates a new `Scales` with SI keys pub fn new() -> Self { - Scales::SI() + Scales::si() } /// Instantiates a new `Scales` with SI keys - pub fn SI() -> Self { + pub fn si() -> Self { Scales { base: 1000, suffixes: vec![ @@ -173,7 +174,7 @@ impl Scales { } /// Instantiates a new `Scales` with Binary keys - pub fn Binary() -> Self { + pub fn binary() -> Self { Scales { base: 1000, suffixes: vec![ @@ -211,8 +212,6 @@ impl Scales { } fn get_magnitude_multipler(&self, value: &str) -> f64 { - let ndx = 0; - for ndx in 0..self.suffixes.len() { if value == self.suffixes[ndx] { return self.base.pow(ndx as u32) as f64;