Skip to content

Commit 6630ad4

Browse files
authored
Merge pull request #36 from ChanTsune/make-doc-examples-testable
Make testable about ByteSize::to_string_as in doc example
2 parents 882d263 + da9433f commit 6630ad4

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)