Remove Option<W>
in BufWriter
#72925
Labels
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-libs
Relevant to the library team, which will review and decide on the PR/issue.
rust/src/libstd/io/buffered.rs
Line 451 in eeaf497
BufWriter
doesn't really need to hold its inner writer as anOption
; it seems like the only reason it does so is to make it easier to callinto_inner
, here:rust/src/libstd/io/buffered.rs
Lines 648 to 653 in eeaf497
While it's unfortunate to add
unsafe
, there's already some inbuffered.rs
, and it seems like the better choice here would be to useptr::read
andmem::forget
, especially because this method is probably infrequently used, and making this change would remove the numerousunwrap
s that litter theBufWriter
implementation.The text was updated successfully, but these errors were encountered: