Skip to content

Commit

Permalink
Fix debug assert range
Browse files Browse the repository at this point in the history
  • Loading branch information
ianthetechie committed Oct 31, 2024
1 parent 888b902 commit a8af17e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion common/ferrostar/src/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<u16>) -> Self {
debug_assert!(degrees >= 0.0 && degrees <= 360.0);
debug_assert!(degrees >= 0.0 && degrees < 360.0);
Self {
degrees: degrees.round() as u16,
accuracy,
Expand Down

0 comments on commit a8af17e

Please sign in to comment.