cargo_inspect/
tmpfile.rs

1pub use crate::errors::InspectError;
2use std::fs::File;
3use std::path::PathBuf;
4use tempfile::tempdir;
5
6/// Create a temporary file
7pub fn tmpfile() -> Result<PathBuf, InspectError> {
8    let tmp_path = tempdir()?.into_path();
9    let file_path = tmp_path.join("temp.rs");
10    File::create(&file_path)?;
11    Ok(file_path)
12}