File tree Expand file tree Collapse file tree 2 files changed +3
-11
lines changed
Expand file tree Collapse file tree 2 files changed +3
-11
lines changed Original file line number Diff line number Diff line change 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.
Original file line number Diff line number Diff line change 2424//! ```
2525//! use bytesize::ByteSize;
2626//!
27- //! assert_eq!("482.4 GiB", ByteSize::gb(518).to_string_as(false));
28- //! assert_eq!("518.0 GB", ByteSize::gb(518).to_string_as(true));
27+ //! assert_eq!("482.4 GiB", ByteSize::gb(518).to_string());
2928//! ```
3029//!
3130//! Arithmetic operations are supported.
@@ -200,15 +199,6 @@ impl ByteSize {
200199 pub const fn as_u64 ( & self ) -> u64 {
201200 self . 0
202201 }
203-
204- #[ inline( always) ]
205- pub fn to_string_as ( & self , si_unit : bool ) -> String {
206- to_string ( self . 0 , si_unit)
207- }
208- }
209-
210- pub fn to_string ( bytes : u64 , si_unit : bool ) -> String {
211- to_string_format ( bytes, if si_unit { Format :: SI } else { Format :: IEC } )
212202}
213203
214204pub fn to_string_format ( bytes : u64 , format : Format ) -> String {
You can’t perform that action at this time.
0 commit comments