pub fn with_contents(contents: &[u8]) -> TempFile
Create a new file in a system temporary directory and writes contents to it.
contents
Panics if it fails to create the file or fails to write all of contents.