Skip to content

Commit 2eb6e0b

Browse files
committed
chore: remove to_string_as method
1 parent 81d885f commit 2eb6e0b

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@
99
- Implement `SubAssign<ByteSize>` for `ByteSize`.
1010
- Implement `SubAssign<impl Into<u64>>` for `ByteSize`.
1111
- Reject parsing non-unit characters after whitespace.
12+
- Remove `ByteSize::to_string_as()` method.
13+
- Remove top-level `to_string()` method.

src/lib.rs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323
//! ```
2424
//! use bytesize::ByteSize;
2525
//!
26-
//! assert_eq!("482.4 GiB", ByteSize::gb(518).to_string_as(false));
27-
//! assert_eq!("518.0 GB", ByteSize::gb(518).to_string_as(true));
26+
//! assert_eq!("482.4 GiB", ByteSize::gb(518).to_string());
2827
//! ```
2928
3029
mod parse;
@@ -186,15 +185,6 @@ impl ByteSize {
186185
pub const fn as_u64(&self) -> u64 {
187186
self.0
188187
}
189-
190-
#[inline(always)]
191-
pub fn to_string_as(&self, si_unit: bool) -> String {
192-
to_string(self.0, si_unit)
193-
}
194-
}
195-
196-
pub fn to_string(bytes: u64, si_unit: bool) -> String {
197-
to_string_format(bytes, if si_unit { Format::SI } else { Format::IEC })
198188
}
199189

200190
pub fn to_string_format(bytes: u64, format: Format) -> String {

0 commit comments

Comments
 (0)