Skip to content

Commit

Permalink
Fixed several errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
RRArny committed Aug 15, 2024
1 parent 79a3f13 commit 7ddafca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
3 changes: 2 additions & 1 deletion src/metar.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use crate::{Config, Position};
use chrono::format;
use chrono::DateTime;
use chrono::FixedOffset;
use chrono::TimeDelta;
Expand Down Expand Up @@ -354,6 +353,8 @@ fn is_exact_match(station: &str, config: &Config) -> bool {
mod tests {
use std::str::FromStr;

use units::{AltitudeUnit, DistanceUnit};

use super::*;

#[test]
Expand Down
13 changes: 4 additions & 9 deletions src/metar/wxcodes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ mod tests {
use std::str::FromStr;

use super::{get_wxcodes_from_json, WxCode, WxCodeIntensity};
use crate::metar::{wxcode_from_str, MetarField, WxCodeProximity};
use crate::metar::{MetarField, WxCodeProximity};

#[test]
fn test_get_regex() {
Expand Down Expand Up @@ -371,13 +371,8 @@ mod tests {

#[test]
fn test_wxcode_from_str() {
let expected: MetarField = MetarField::WxCode(
WxCode::Ra,
WxCodeIntensity::Light,
WxCodeProximity::OnStation,
crate::metar::WxCodeDescription::None,
);
let actual = wxcode_from_str("-RA");
assert_eq!(Some(expected), actual);
let expected = WxCode::Ra;
let actual = WxCode::from_str("-RA").unwrap();
assert_eq!(expected, actual);
}
}

0 comments on commit 7ddafca

Please sign in to comment.