Skip to content

Commit da9433f

Browse files
committed
Make testable about ByteSize::to_string_as in doc example
1 parent cb77498 commit da9433f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/lib.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@
2222
//!
2323
//! It also provides its human readable string as follows:
2424
//!
25-
//! ```ignore=
26-
//! assert_eq!("482 GiB".to_string(), ByteSize::gb(518).to_string(true));
27-
//! assert_eq!("518 GB".to_string(), ByteSize::gb(518).to_string(false));
25+
//! ```
26+
//! use bytesize::ByteSize;
27+
//!
28+
//! assert_eq!("482.4 GiB", ByteSize::gb(518).to_string_as(true));
29+
//! assert_eq!("518.0 GB", ByteSize::gb(518).to_string_as(false));
2830
//! ```
2931
3032
mod parse;

0 commit comments

Comments
 (0)