|
1 | 1 | use crate::color::{ColoredString, Colors, Elem};
|
2 | 2 | use crate::flags::{Flags, SizeFlag};
|
| 3 | +use num_format::ToFormattedString; |
3 | 4 | use std::fs::Metadata;
|
4 | 5 | use std::iter::repeat;
|
5 |
| -use num_format::{ToFormattedString}; |
6 | 6 |
|
7 | 7 | #[derive(Clone, Debug, PartialEq, Eq)]
|
8 | 8 | pub enum Unit {
|
@@ -58,7 +58,7 @@ impl Size {
|
58 | 58 |
|
59 | 59 | #[cfg(not(unix))]
|
60 | 60 | fn os_formatted_bytes(&self) -> String {
|
61 |
| - self.bytes.to_formatted_string(&Locale::en) |
| 61 | + self.bytes.to_formatted_string(&num_format::Locale::en) |
62 | 62 | }
|
63 | 63 |
|
64 | 64 | pub fn get_unit(&self, flags: &Flags) -> Unit {
|
@@ -184,10 +184,10 @@ impl Size {
|
184 | 184 |
|
185 | 185 | #[cfg(test)]
|
186 | 186 | mod test {
|
187 |
| - use std::env; |
188 | 187 | use super::Size;
|
189 | 188 | use crate::color::{Colors, ThemeOption};
|
190 | 189 | use crate::flags::{Flags, SizeFlag};
|
| 190 | + use std::env; |
191 | 191 |
|
192 | 192 | #[test]
|
193 | 193 | fn render_byte() {
|
@@ -367,7 +367,8 @@ mod test {
|
367 | 367 | #[cfg(unix)]
|
368 | 368 | #[test]
|
369 | 369 | fn render_bytes_with_separator() {
|
370 |
| - env::set_var("LC_ALL", "en"); |
| 370 | + env::set_var("LC_ALL", "en-US"); |
| 371 | + env::set_var("LC_NUMERIC", ","); |
371 | 372 | let size = Size::new(42 * 1024 * 1024); // == 42 megabytes
|
372 | 373 | let mut flags = Flags::default();
|
373 | 374 |
|
|
0 commit comments