You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.5 KiB
38 lines
1.5 KiB
6 years ago
|
From 2d0768c8d2c4ab28f8b6bb7fb8b2fdcce2af987f Mon Sep 17 00:00:00 2001
|
||
|
From: Bernardo Meurer <meurerbernardo@gmail.com>
|
||
|
Date: Tue, 16 Apr 2019 22:54:06 -0700
|
||
|
Subject: [PATCH] Fix usages of number_prefix
|
||
|
|
||
|
---
|
||
|
src/output/render/size.rs | 7 +++----
|
||
|
1 file changed, 3 insertions(+), 4 deletions(-)
|
||
|
|
||
|
diff --git a/src/output/render/size.rs b/src/output/render/size.rs
|
||
|
index 25b2007..da9c709 100644
|
||
|
--- a/src/output/render/size.rs
|
||
|
+++ b/src/output/render/size.rs
|
||
|
@@ -9,8 +9,7 @@ use output::table::SizeFormat;
|
||
|
|
||
|
impl f::Size {
|
||
|
pub fn render<C: Colours>(&self, colours: &C, size_format: SizeFormat, numerics: &NumericLocale) -> TextCell {
|
||
|
- use number_prefix::{binary_prefix, decimal_prefix};
|
||
|
- use number_prefix::{Prefixed, Standalone, PrefixNames};
|
||
|
+ use number_prefix::{Prefixed, Standalone, NumberPrefix, PrefixNames};
|
||
|
|
||
|
let size = match *self {
|
||
|
f::Size::Some(s) => s,
|
||
|
@@ -19,8 +18,8 @@ impl f::Size {
|
||
|
};
|
||
|
|
||
|
let result = match size_format {
|
||
|
- SizeFormat::DecimalBytes => decimal_prefix(size as f64),
|
||
|
- SizeFormat::BinaryBytes => binary_prefix(size as f64),
|
||
|
+ SizeFormat::DecimalBytes => NumberPrefix::decimal(size as f64),
|
||
|
+ SizeFormat::BinaryBytes => NumberPrefix::binary(size as f64),
|
||
|
SizeFormat::JustBytes => {
|
||
|
let string = numerics.format_int(size);
|
||
|
return TextCell::paint(colours.size(size), string);
|
||
|
--
|
||
|
2.21.0
|
||
|
|