Created
February 22, 2017 21:01
-
-
Save mitsuhiko/89501e90ef6fd17023ba1d8ee1b0ce42 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
fn with_file<X: ?Sized, T, F: FnOnce(&mut X) -> T>(&self, f: F) -> T { | |
if self.options.compress { | |
f(&mut *self.tempfile.as_ref().unwrap().borrow_mut() as &mut X) | |
} else { | |
f(&mut *self.writer.borrow_mut() as &mut X) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment