Skip to content

Commit

Permalink
Merge pull request #36 from ChanTsune/make-doc-examples-testable
Browse files Browse the repository at this point in the history
Make testable about ByteSize::to_string_as in doc example
  • Loading branch information
hyunsik authored Sep 6, 2023
2 parents 882d263 + da9433f commit 6630ad4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@
//!
//! It also provides its human readable string as follows:
//!
//! ```ignore=
//! assert_eq!("482 GiB".to_string(), ByteSize::gb(518).to_string(true));
//! assert_eq!("518 GB".to_string(), ByteSize::gb(518).to_string(false));
//! ```
//! use bytesize::ByteSize;
//!
//! assert_eq!("482.4 GiB", ByteSize::gb(518).to_string_as(true));
//! assert_eq!("518.0 GB", ByteSize::gb(518).to_string_as(false));
//! ```

mod parse;
Expand Down

0 comments on commit 6630ad4

Please sign in to comment.