Skip to content

Build ByteSize from other number type #135

@tisonkun

Description

@tisonkun

When trying to port humansize code to bytesize, I noticed that if the purpose is only for formatting to byte size, many inputs are usize or even positive isize. Forcing each place to case to u64 can be wordy.

Not sure if it can be possible to have a lossy constructor, or I should use humansize in this case.

Previous discussion - #7

humansize trait - https://docs.rs/humansize/2.1.3/humansize/struct.ISizeFormatter.html & https://docs.rs/humansize/2.1.3/humansize/trait.ToF64.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions