Use new number_prefix API

This commit is contained in:
Valentin Brandl 2020-05-01 13:18:22 +02:00
parent 0edceb6a7d
commit 45c0d26e33
No known key found for this signature in database
GPG Key ID: 30D341DD34118D7D

View File

@ -31,7 +31,7 @@ use actix_web::{
use badge::{Badge, BadgeOptions};
use futures::future::Future;
use git2::Repository;
use number_prefix::{NumberPrefix, Prefixed, Standalone};
use number_prefix::NumberPrefix;
use std::{
borrow::Cow,
fs::create_dir_all,
@ -193,8 +193,8 @@ where
pull(&path)?;
let (hoc, head, commits) = hoc(&service_path, &state.repos, &state.cache)?;
let hoc_pretty = match NumberPrefix::decimal(hoc as f64) {
Standalone(hoc) => hoc.to_string(),
Prefixed(prefix, hoc) => format!("{:.1}{}", hoc, prefix),
NumberPrefix::Standalone(hoc) => hoc.to_string(),
NumberPrefix::Prefixed(prefix, hoc) => format!("{:.1}{}", hoc, prefix),
};
let res = HocResult::Hoc {
hoc,