Skip to content

Commit

Permalink
return Load::Unknown for value of 0 because it means we misread some …
Browse files Browse the repository at this point in the history
…data
  • Loading branch information
jstuczyn committed Jan 10, 2025
1 parent 26b1133 commit ba9b0ea
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion nym-node/nym-node-requests/src/api/v1/node_load/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ impl Load {

impl From<f64> for Load {
fn from(value: f64) -> Self {
if value <= 0.1 {
if value == 0. || value.is_nan() || value.is_infinite() {
Self::Unknown
} else if value <= 0.1 {
Self::Negligible
} else if value <= 0.3 {
Self::Low
Expand Down

0 comments on commit ba9b0ea

Please sign in to comment.