-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
scubainit: Avoid lifetimes on EntFile{Reader,Writer}
Rather than use lifetimes on the EntFileReader and EntFileWriter structs, we can implement the common into_inner() convention. This consumes the outer object returning the inner wrapped object, which in this case is the File which we want to reuse. This matches e.g. `std::io::BufReader::into_inner()`. Note that this also requires changing the way the reader is iterated: We use `for x in &mut reader` which avoids moving the `reader` object into the loop, allowing `into_inner()` to be subsequently called. See the discussion here: #239 (comment).
- Loading branch information
1 parent
1adca37
commit 4333f41
Showing
5 changed files
with
37 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters