#[must_use]
pub(super) fn coverage_percent_text(known: usize, unknown: usize) -> String {
let Some(total) = known.checked_add(unknown) else {
return "-".to_string();
};
let (Ok(known), Ok(total)) = (u64::try_from(known), u64::try_from(total)) else {
return "-".to_string();
};
ratio_percent_text(known, total)
}
#[must_use]
pub(super) fn ratio_percent_text(numerator: u64, denominator: u64) -> String {
ic_host_text::percent::ratio_percent_text(numerator, denominator)
.unwrap_or_else(|| "-".to_string())
}
#[cfg(test)]
mod tests;