Closed
Description
I am creating a wrapper for the File type and came across an issue that I thought was odd.
Both of these methods take an immutable reference (&self
) to the File instead of a mutable reference (&mut self
).
I'm not so much concerned about memory safety per se, as I assume that the operating system guarantees that operaions are memory safe, it is just that this is extremely unexpected. If I pass a function an immutable reference to a File
, I wouldn't expect it to be able to truncate the file!
Obviously this is a breaking change so probably can't be changed -- however, I was thinking we could at least add docs explaining why the reference is immutable.