You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Whilst reviewing #721, I found initially thought the unwrap() in this usage was an unwrap() in the sense of Result::unwrap() and something that could panic:
Instead, it seems MappedWrite::unwrap in fact returns the inner writer, and can never panic.
Searching around for whether there was prior art we could base the naming on (returning some inner field), I found that BufWriter actually has an into_inner which does exactly what we're doing in MappedWrite::unwrap: https://doc.rust-lang.org/std/io/struct.BufWriter.html#method.into_inner
As such, renaming to MappedWrite::into_inner seems to make sense to me?
Whilst reviewing #721, I found initially thought the
unwrap()
in this usage was anunwrap()
in the sense ofResult::unwrap()
and something that could panic:Instead, it seems
MappedWrite::unwrap
in fact returns the inner writer, and can never panic.Searching around for whether there was prior art we could base the naming on (returning some inner field), I found that
BufWriter
actually has aninto_inner
which does exactly what we're doing inMappedWrite::unwrap
:https://doc.rust-lang.org/std/io/struct.BufWriter.html#method.into_inner
As such, renaming to
MappedWrite::into_inner
seems to make sense to me?@Malax Thoughts?
The text was updated successfully, but these errors were encountered: