I noticed that all of the number type in Arg
is u64, why aren't they usize?
@Donough Liu usize
is appropriate for "size of an array or string or similar that fits in memory". It isn't appropriate for arbitrary numeric values.
An arbitrary numeric command-line argument should not have a maximum size that varies by platform.
@Josh Triplett All of the u64
in the Arg
is for array size. Changing them to usize doesn't affect a numeric argument's value range. :sweat_smile:
It's pretty internal though.
Ah, sorry, I didn't realize you meant internal to a structure.
Thanks for clarifying.
Then yeah, usize
sounds fine.