From a8af17e8e199108f6f723e2eb27f188e2fd3fac6 Mon Sep 17 00:00:00 2001 From: Ian Wagner Date: Thu, 31 Oct 2024 12:18:14 +0900 Subject: [PATCH] Fix debug assert range --- common/ferrostar/src/models.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/ferrostar/src/models.rs b/common/ferrostar/src/models.rs index 29225ee8..176c2890 100644 --- a/common/ferrostar/src/models.rs +++ b/common/ferrostar/src/models.rs @@ -175,9 +175,10 @@ impl CourseOverGround { /// /// - degrees: The direction in which the user's device is traveling, measured in clockwise degrees from /// true north (N = 0, E = 90, S = 180, W = 270). + /// NOTE: Input values must lie in the range [0, 360). /// - accuracy: the accuracy of the course value, measured in degrees. pub fn new(degrees: f64, accuracy: Option) -> Self { - debug_assert!(degrees >= 0.0 && degrees <= 360.0); + debug_assert!(degrees >= 0.0 && degrees < 360.0); Self { degrees: degrees.round() as u16, accuracy,