rust/library
Dylan DPC c5e612ce6b
Rollup merge of #85146 - ijackson:seek-rewind, r=m-ou-se
Provide io::Seek::rewind

Using `Seek::seek` is slightly clumsy because of the need to write (or import) `std::io::SeekFrom` to get at `SeekStart`.  C already has `rewind` (although with broken error handling); we should have it too.

I'm motivated to do this because I've just found myself copy-pasting my 5-line extension trait between projects.

That the example ends up using `OpenOptions` makes this look like a niche use case, but it is very common to rewind temporary files.  `tempfile` isn't available for use in this example or it would have looked shorter and more natural.

If this gets a positive reception I will open a tracking issue and update the feature gate.
2021-05-10 16:15:05 +02:00
..
2021-04-25 13:48:03 -07:00
2021-04-09 15:33:43 +02:00
2021-05-02 17:46:00 -06:00
2021-05-10 13:55:31 +01:00
2021-05-08 19:40:27 +01:00