From 8f7a9d8f9d179021bd7035a068c62bb789510c9f Mon Sep 17 00:00:00 2001 From: RRArny <1297660+RRArny@users.noreply.github.com> Date: Thu, 15 Aug 2024 19:51:02 +0200 Subject: [PATCH] Delete clippy-report --- clippy-report | 719 -------------------------------------------------- 1 file changed, 719 deletions(-) delete mode 100644 clippy-report diff --git a/clippy-report b/clippy-report deleted file mode 100644 index a943f13..0000000 --- a/clippy-report +++ /dev/null @@ -1,719 +0,0 @@ -warning: redundant else block - --> src/main.rs:61:16 - | -61 | } else { - | ________________^ -62 | | println!("Invalid airfield {}. Defaulting to geoip...", icao); -63 | | } - | |_________^ - | - = help: remove the `else` block and move the contents out - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_else - = note: `-W clippy::redundant-else` implied by `-W clippy::pedantic` - = help: to override `-W clippy::pedantic` add `#[allow(clippy::redundant_else)]` - -warning: redundant else block - --> src/main.rs:69:16 - | -69 | ... } else { - | ______________^ -70 | | ... println!("Please provide both Latitude and Longitude. Defaulting to geoip.... -71 | | ... } - | |_______^ - | - = help: remove the `else` block and move the contents out - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_else - -warning: item in documentation is missing backticks - --> src/metar/clouds.rs:25:54 - | -25 | /// Parses a METAR in JSON form and returns a Vec of MetarField::Clouds describing the... - | ^^^^^^^^^^^^^^^^^^ - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown - = note: `-W clippy::doc-markdown` implied by `-W clippy::pedantic` - = help: to override `-W clippy::pedantic` add `#[allow(clippy::doc_markdown)]` -help: try - | -25 | /// Parses a METAR in JSON form and returns a Vec of `MetarField::Clouds` describing the cloud information contained. - | ~~~~~~~~~~~~~~~~~~~~ - -warning: item name ends with its containing module's name - --> src/metar/clouds.rs:26:8 - | -26 | pub fn get_clouds(json: &Value) -> Vec { - | ^^^^^^^^^^ - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions - = note: `-W clippy::module-name-repetitions` implied by `-W clippy::pedantic` - = help: to override `-W clippy::pedantic` add `#[allow(clippy::module_name_repetitions)]` - -warning: item in documentation is missing backticks - --> src/metar/clouds.rs:40:77 - | -40 | ...sentation string (&str) parses a MetarField::Cloud. - | ^^^^^^^^^^^^^^^^^ - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown -help: try - | -40 | /// From a METAR compliant cloud code representation string (&str) parses a `MetarField::Cloud`. - | ~~~~~~~~~~~~~~~~~~~ - -warning: single-character string constant used as pattern - --> src/metar/clouds.rs:59:26 - | -59 | if res.ends_with("|") { - | ^^^ help: consider using a `char`: `'|'` - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern - = note: `-W clippy::single-char-pattern` implied by `-W clippy::pedantic` - = help: to override `-W clippy::pedantic` add `#[allow(clippy::single_char_pattern)]` - -warning: variables can be used directly in the `format!` string - --> src/metar/clouds.rs:90:9 - | -90 | write!(f, "{}", str_repr) - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args - = note: `-W clippy::uninlined-format-args` implied by `-W clippy::pedantic` - = help: to override `-W clippy::pedantic` add `#[allow(clippy::uninlined_format_args)]` -help: change this to - | -90 - write!(f, "{}", str_repr) -90 + write!(f, "{str_repr}") - | - -warning: this match arm has an identical body to the `_` wildcard arm - --> src/metar/units.rs:136:13 - | -136 | / "m" => Self::M, -137 | | "nm" => Self::Nm, - | |____________^ help: try removing the arm - | - = help: or try changing either arm body -note: `_` wildcard arm here - --> src/metar/units.rs:140:13 - | -140 | _ => Self::M, - | ^^^^^^^^^^^^ - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_same_arms - = note: `-W clippy::match-same-arms` implied by `-W clippy::pedantic` - = help: to override `-W clippy::pedantic` add `#[allow(clippy::match_same_arms)]` - -warning: empty String is being created manually - --> src/metar/wxcodes.rs:60:31 - | -60 | let mut res: String = String::from(""); - | ^^^^^^^^^^^^^^^^ help: consider using: `String::new()` - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_string_new - = note: `-W clippy::manual-string-new` implied by `-W clippy::pedantic` - = help: to override `-W clippy::pedantic` add `#[allow(clippy::manual_string_new)]` - -warning: single-character string constant used as pattern - --> src/metar/wxcodes.rs:65:26 - | -65 | if res.ends_with("|") { - | ^^^ help: consider using a `char`: `'|'` - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern - -warning: empty String is being created manually - --> src/metar/wxcodes.rs:125:31 - | -125 | let mut res: String = String::from(""); - | ^^^^^^^^^^^^^^^^ help: consider using: `String::new()` - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_string_new - -warning: single-character string constant used as pattern - --> src/metar/wxcodes.rs:130:26 - | -130 | if res.ends_with("|") { - | ^^^ help: consider using a `char`: `'|'` - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern - -warning: empty String is being created manually - --> src/metar/wxcodes.rs:175:31 - | -175 | let mut res: String = String::from(""); - | ^^^^^^^^^^^^^^^^ help: consider using: `String::new()` - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_string_new - -warning: single-character string constant used as pattern - --> src/metar/wxcodes.rs:183:26 - | -183 | if res.ends_with("|") { - | ^^^ help: consider using a `char`: `'|'` - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern - -warning: variables can be used directly in the `format!` string - --> src/metar/wxcodes.rs:235:9 - | -235 | write!(f, "{}", str_repr) - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args -help: change this to - | -235 - write!(f, "{}", str_repr) -235 + write!(f, "{str_repr}") - | - -warning: variables can be used directly in the `format!` string - --> src/metar/wxcodes.rs:265:9 - | -265 | write!(f, "{}", str_repr) - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args -help: change this to - | -265 - write!(f, "{}", str_repr) -265 + write!(f, "{str_repr}") - | - -warning: variables can be used directly in the `format!` string - --> src/metar/wxcodes.rs:276:9 - | -276 | write!(f, "{}", str_repr) - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args -help: change this to - | -276 - write!(f, "{}", str_repr) -276 + write!(f, "{str_repr}") - | - -warning: variables can be used directly in the `format!` string - --> src/metar/wxcodes.rs:293:9 - | -293 | write!(f, "{}", str_repr) - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args -help: change this to - | -293 - write!(f, "{}", str_repr) -293 + write!(f, "{str_repr}") - | - -warning: item name ends with its containing module's name - --> src/metar/wxcodes.rs:316:8 - | -316 | pub fn get_wxcodes(json: &Value) -> Vec { - | ^^^^^^^^^^^ - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions - -warning: usage of wildcard import - --> src/metar.rs:14:5 - | -14 | use crate::metar::clouds::*; - | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `crate::metar::clouds::{Clouds, get_clouds}` - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_imports - = note: `-W clippy::wildcard-imports` implied by `-W clippy::pedantic` - = help: to override `-W clippy::pedantic` add `#[allow(clippy::wildcard_imports)]` - -warning: usage of wildcard import - --> src/metar.rs:15:5 - | -15 | use crate::metar::units::*; - | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `crate::metar::units::{PressureUnit, SpeedUnit, TemperatureUnit, Units}` - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_imports - -warning: usage of wildcard import - --> src/metar.rs:16:5 - | -16 | use crate::metar::wxcodes::*; - | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `crate::metar::wxcodes::{WxCode, WxCodeDescription, WxCodeIntensity, WxCodeProximity, get_wxcodes}` - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_imports - -warning: item name starts with its containing module's name - --> src/metar.rs:32:10 - | -32 | pub enum MetarField { - | ^^^^^^^^^^ - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions - -warning: variables can be used directly in the `format!` string - --> src/metar.rs:96:5 - | -96 | format!("{}{}{}{}", _intensity, _descriptor, _code, _proximity).magenta() - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args -help: change this to - | -96 - format!("{}{}{}{}", _intensity, _descriptor, _code, _proximity).magenta() -96 + format!("{_intensity}{_descriptor}{_code}{_proximity}").magenta() - | - -warning: used binding `_intensity` which is prefixed with an underscore. A leading underscore signals that a binding will not be used - --> src/metar.rs:96:25 - | -96 | format!("{}{}{}{}", _intensity, _descriptor, _code, _proximity).magenta() - | ^^^^^^^^^^ - | -note: `_intensity` is defined here - --> src/metar.rs:91:5 - | -91 | _intensity: &WxCodeIntensity, - | ^^^^^^^^^^ - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#used_underscore_binding - = note: `-W clippy::used-underscore-binding` implied by `-W clippy::pedantic` - = help: to override `-W clippy::pedantic` add `#[allow(clippy::used_underscore_binding)]` - -warning: used binding `_descriptor` which is prefixed with an underscore. A leading underscore signals that a binding will not be used - --> src/metar.rs:96:37 - | -96 | format!("{}{}{}{}", _intensity, _descriptor, _code, _proximity).magenta() - | ^^^^^^^^^^^ - | -note: `_descriptor` is defined here - --> src/metar.rs:93:5 - | -93 | _descriptor: &WxCodeDescription, - | ^^^^^^^^^^^ - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#used_underscore_binding - -warning: used binding `_code` which is prefixed with an underscore. A leading underscore signals that a binding will not be used - --> src/metar.rs:96:50 - | -96 | format!("{}{}{}{}", _intensity, _descriptor, _code, _proximity).magenta() - | ^^^^^ - | -note: `_code` is defined here - --> src/metar.rs:90:5 - | -90 | _code: &WxCode, - | ^^^^^ - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#used_underscore_binding - -warning: used binding `_proximity` which is prefixed with an underscore. A leading underscore signals that a binding will not be used - --> src/metar.rs:96:57 - | -96 | format!("{}{}{}{}", _intensity, _descriptor, _code, _proximity).magenta() - | ^^^^^^^^^^ - | -note: `_proximity` is defined here - --> src/metar.rs:92:5 - | -92 | _proximity: &WxCodeProximity, - | ^^^^^^^^^^ - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#used_underscore_binding - -warning: this argument (8 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte) - --> src/metar.rs:99:23 - | -99 | fn colourise_qnh(qnh: &i64, unit: &PressureUnit) -> ColoredString { - | ^^^^ help: consider passing by value instead: `i64` - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref - = note: `-W clippy::trivially-copy-pass-by-ref` implied by `-W clippy::pedantic` - = help: to override `-W clippy::pedantic` add `#[allow(clippy::trivially_copy_pass_by_ref)]` - -warning: this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte) - --> src/metar.rs:99:35 - | -99 | fn colourise_qnh(qnh: &i64, unit: &PressureUnit) -> ColoredString { - | ^^^^^^^^^^^^^ help: consider passing by value instead: `PressureUnit` - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref - -warning: variables can be used directly in the `format!` string - --> src/metar.rs:101:30 - | -101 | PressureUnit::Hpa => format!("Q{}", qnh).color(if *qnh >= 1013 { - | ^^^^^^^^^^^^^^^^^^^ - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args -help: change this to - | -101 - PressureUnit::Hpa => format!("Q{}", qnh).color(if *qnh >= 1013 { -101 + PressureUnit::Hpa => format!("Q{qnh}").color(if *qnh >= 1013 { - | - -warning: this argument (8 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte) - --> src/metar.rs:114:32 - | -114 | fn colourise_temperature(temp: &i64, dewpoint: &i64, _unit: &TemperatureUnit) -> Colo... - | ^^^^ help: consider passing by value instead: `i64` - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref - -warning: this argument (8 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte) - --> src/metar.rs:114:48 - | -114 | ...i64, dewpoint: &i64, _unit: &TemperatureUnit) -> ColoredString { - | ^^^^ help: consider passing by value instead: `i64` - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref - -warning: this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte) - --> src/metar.rs:114:61 - | -114 | ...t: &TemperatureUnit) -> ColoredString { - | ^^^^^^^^^^^^^^^^ help: consider passing by value instead: `TemperatureUnit` - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref - -warning: variables can be used directly in the `format!` string - --> src/metar.rs:125:5 - | -125 | format!("{}/{}", temp_str, dew_str).into() - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args -help: change this to - | -125 - format!("{}/{}", temp_str, dew_str).into() -125 + format!("{temp_str}/{dew_str}").into() - | - -warning: this argument (8 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte) - --> src/metar.rs:128:32 - | -128 | fn colourise_wind_var(low_dir: &i64, hi_dir: &i64) -> ColoredString { - | ^^^^ help: consider passing by value instead: `i64` - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref - -warning: this argument (8 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte) - --> src/metar.rs:128:46 - | -128 | fn colourise_wind_var(low_dir: &i64, hi_dir: &i64) -> ColoredString { - | ^^^^ help: consider passing by value instead: `i64` - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref - -warning: variables can be used directly in the `format!` string - --> src/metar.rs:129:5 - | -129 | format!("{}V{}", low_dir, hi_dir).color(if hi_dir - low_dir < 45 { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args -help: change this to - | -129 - format!("{}V{}", low_dir, hi_dir).color(if hi_dir - low_dir < 45 { -129 + format!("{low_dir}V{hi_dir}").color(if hi_dir - low_dir < 45 { - | - -warning: this argument (8 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte) - --> src/metar.rs:137:16 - | -137 | direction: &i64, - | ^^^^ help: consider passing by value instead: `i64` - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref - -warning: this argument (8 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte) - --> src/metar.rs:138:15 - | -138 | strength: &i64, - | ^^^^ help: consider passing by value instead: `i64` - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref - -warning: this argument (8 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte) - --> src/metar.rs:139:12 - | -139 | gusts: &i64, - | ^^^^ help: consider passing by value instead: `i64` - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref - -warning: this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte) - --> src/metar.rs:140:12 - | -140 | _unit: &SpeedUnit, - | ^^^^^^^^^^ help: consider passing by value instead: `SpeedUnit` - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref - -warning: variables can be used directly in the `format!` string - --> src/metar.rs:142:19 - | -142 | let dir_str = format!("{:03}", direction).to_string(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args -help: change this to - | -142 - let dir_str = format!("{:03}", direction).to_string(); -142 + let dir_str = format!("{direction:03}").to_string(); - | - -warning: variables can be used directly in the `format!` string - --> src/metar.rs:143:24 - | -143 | let strength_str = format!("{:02}", strength) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args -help: change this to - | -143 - let strength_str = format!("{:02}", strength) -143 + let strength_str = format!("{strength:02}") - | - -warning: variables can be used directly in the `format!` string - --> src/metar.rs:150:37 - | -150 | let mut output: ColoredString = format!("{}{}", dir_str, strength_str).into(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args -help: change this to - | -150 - let mut output: ColoredString = format!("{}{}", dir_str, strength_str).into(); -150 + let mut output: ColoredString = format!("{dir_str}{strength_str}").into(); - | - -warning: variables can be used directly in the `format!` string - --> src/metar.rs:152:24 - | -152 | let gust_str = format!("{:02}", gusts) - | ^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args -help: change this to - | -152 - let gust_str = format!("{:02}", gusts) -152 + let gust_str = format!("{gusts:02}") - | - -warning: variables can be used directly in the `format!` string - --> src/metar.rs:159:18 - | -159 | output = format!("{}G{}", output, gust_str).into(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args -help: change this to - | -159 - output = format!("{}G{}", output, gust_str).into(); -159 + output = format!("{output}G{gust_str}").into(); - | - -warning: variables can be used directly in the `format!` string - --> src/metar.rs:161:14 - | -161 | output = format!("{}KT", output).into(); - | ^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args -help: change this to - | -161 - output = format!("{}KT", output).into(); -161 + output = format!("{output}KT").into(); - | - -warning: this argument (8 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte) - --> src/metar.rs:179:30 - | -179 | fn colourise_visibility(vis: &i64) -> ColoredString { - | ^^^^ help: consider passing by value instead: `i64` - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref - -warning: this argument is passed by value, but not consumed in the function body - --> src/metar.rs:190:28 - | -190 | pub fn from_json(json: Value, config: &Config) -> Option { - | ^^^^^ help: consider taking a reference instead: `&Value` - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_value - = note: `-W clippy::needless-pass-by-value` implied by `-W clippy::pedantic` - = help: to override `-W clippy::pedantic` add `#[allow(clippy::needless_pass_by_value)]` - -warning: this argument (5 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte) - --> src/metar.rs:269:33 - | -269 | fn get_qnh(json: &Value, units: &Units) -> Option { - | ^^^^^^ help: consider passing by value instead: `Units` - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref - -warning: casting `f64` to `i64` may truncate the value - --> src/metar.rs:272:9 - | -272 | qnh_val.as_f64()?.mul(100.).round() as i64 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_truncation - = note: `-W clippy::cast-possible-truncation` implied by `-W clippy::pedantic` - = help: to override `-W clippy::pedantic` add `#[allow(clippy::cast_possible_truncation)]` - -warning: this argument (5 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte) - --> src/metar.rs:280:34 - | -280 | fn get_temp(json: &Value, units: &Units) -> Option { - | ^^^^^^ help: consider passing by value instead: `Units` - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref - -warning: used `sort` on primitive type `i64` - --> src/metar.rs:296:5 - | -296 | dirs.sort(); - | ^^^^^^^^^^^ help: try: `dirs.sort_unstable()` - | - = note: an unstable sort typically performs faster without any observable difference for this data type - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#stable_sort_primitive - = note: `-W clippy::stable-sort-primitive` implied by `-W clippy::pedantic` - = help: to override `-W clippy::pedantic` add `#[allow(clippy::stable_sort_primitive)]` - -warning: this argument (5 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte) - --> src/metar.rs:305:35 - | -305 | fn get_winds(json: &Value, units: &Units) -> Option { - | ^^^^^^ help: consider passing by value instead: `Units` - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref - -warning: redundant closure - --> src/metar.rs:311:19 - | -311 | .and_then(|g| g.as_i64()) - | ^^^^^^^^^^^^^^ help: replace the closure with the method itself: `serde_json::Value::as_i64` - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_for_method_calls - = note: `-W clippy::redundant-closure-for-method-calls` implied by `-W clippy::pedantic` - = help: to override `-W clippy::pedantic` add `#[allow(clippy::redundant_closure_for_method_calls)]` - -warning: this argument (5 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte) - --> src/metar.rs:322:41 - | -322 | fn get_visibility(json: &Value, _units: &Units) -> Option { - | ^^^^^^ help: consider passing by value instead: `Units` - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref - -warning: item in documentation is missing backticks - --> src/api.rs:26:81 - | -26 | ...tring and Secrets, requests METAR from AvWx and wraps the Response in a Result. - | ^^^^ - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown -help: try - | -26 | /// Given a properly formattet position string and Secrets, requests METAR from `AvWx` and wraps the Response in a Result. - | ~~~~~~ - -warning: variables can be used directly in the `format!` string - --> src/api.rs:28:15 - | -28 | let uri = format!( - | _______________^ -29 | | "https://avwx.rest/api/metar/{}?onfail=nearest&options=info", -30 | | position -31 | | ); - | |_____^ - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args - -warning: variables can be used directly in the `format!` string - --> src/api.rs:58:5 - | -58 | println!("{}/{}", lat, lon); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args -help: change this to - | -58 - println!("{}/{}", lat, lon); -58 + println!("{lat}/{lon}"); - | - -warning: variables can be used directly in the `format!` string - --> src/api.rs:60:15 - | -60 | let uri = format!( - | _______________^ -61 | | "https://avwx.rest/api/station/near/{},{}?n=1&reporting=true", -62 | | lat, lon -63 | | ); - | |_____^ - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args - -warning: variables can be used directly in the `format!` string - --> src/api.rs:70:5 - | -70 | println!("{:?}", resp); - | ^^^^^^^^^^^^^^^^^^^^^^ - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args -help: change this to - | -70 - println!("{:?}", resp); -70 + println!("{resp:?}"); - | - -warning: item in documentation is missing backticks - --> src/api.rs:78:80 - | -78 | /// For a given ICAO code as String and the necessary Secrets makes request to AvWx to... - | ^^^^ - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown -help: try - | -78 | /// For a given ICAO code as String and the necessary Secrets makes request to `AvWx` to check if the code is valid. - | ~~~~~~ - -warning: variables can be used directly in the `format!` string - --> src/api.rs:80:15 - | -80 | let uri = format!("https://avwx.rest/api/station/{}", icao); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args -help: change this to - | -80 - let uri = format!("https://avwx.rest/api/station/{}", icao); -80 + let uri = format!("https://avwx.rest/api/station/{icao}"); - | - -warning: variables can be used directly in the `format!` string - --> src/main.rs:62:13 - | -62 | println!("Invalid airfield {}. Defaulting to geoip...", icao); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args -help: change this to - | -62 - println!("Invalid airfield {}. Defaulting to geoip...", icao); -62 + println!("Invalid airfield {icao}. Defaulting to geoip..."); - | - -warning: variables can be used directly in the `format!` string - --> src/main.rs:92:5 - | -92 | println!("{}", wx_string); - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args -help: change this to - | -92 - println!("{}", wx_string); -92 + println!("{wx_string}"); - | - -warning: `wxfetch` (bin "wxfetch") generated 66 warnings (run `cargo clippy --fix --bin "wxfetch"` to apply 38 suggestions) - Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.08s