Skip to content

Commit b325461

Browse files
committed
added percentile null handle
1 parent f4fdfd7 commit b325461

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

compute/src/node/diagnostic.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ impl DriaComputeNode {
2626
let earned = steps.score - self.initial_steps;
2727
diagnostics.push(format!(
2828
"$DRIA Points: {} total, {} earned in this run, within top {}%",
29-
steps.score, earned, steps.percentile
29+
steps.score,
30+
earned,
31+
steps.percentile.unwrap_or("100%".to_string())
3032
));
3133
}
3234

compute/src/utils/points.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ pub struct DriaPoints {
99
/// Indicates in which top percentile your points are.
1010
///
1111
/// TODO: can be number in API
12-
pub percentile: String,
12+
/// TODO: API sometimes returns `null` here?
13+
pub percentile: Option<String>,
1314
/// The total number of points you have accumulated.
1415
pub score: f64,
1516
}

0 commit comments

Comments
 (0)