It's a breaking change but I am very strongly inclined to remove them in next release.
Reasons:
one can accidentally pass usize to pwrite and it writes an 8 byte number (if you're on 64-bit machine), i.e., something coming from len()`, when you actually meant to write a u32 (but forgot to cast). This has happened several times to me, and tracking down why the 4 extra bytes got written is evil.
there are little to no reasons why you need to serialize what is effectively a variable sized type to disk; if you want it to be a usize, cast the known length thing after you deserialize; if you want to serialize a usize, choose a u32 or u64 and serialize, so all machines can write the same on-disk/wire datatype.
Unless someone provides compelling reasons to not remove, I will do so; please let me know if you really need this feature!
It's a breaking change but I am very strongly inclined to remove them in next release.
Reasons:
usize
topwrite
and it writes an 8 byte number (if you're on 64-bit machine), i.e., something coming fromlen
()`, when you actually meant to write a u32 (but forgot to cast). This has happened several times to me, and tracking down why the 4 extra bytes got written is evil.usize
, choose au32
oru64
and serialize, so all machines can write the same on-disk/wire datatype.Unless someone provides compelling reasons to not remove, I will do so; please let me know if you really need this feature!