(path: &Path, contents: &str, owner_only: bool)
| 757 | } |
| 758 | |
| 759 | fn write_pem(path: &Path, contents: &str, owner_only: bool) -> Result<()> { |
| 760 | std::fs::write(path, contents) |
| 761 | .into_diagnostic() |
| 762 | .wrap_err_with(|| format!("failed to write {}", path.display()))?; |
| 763 | if owner_only { |
| 764 | set_file_owner_only(path)?; |
| 765 | } |
| 766 | Ok(()) |
| 767 | } |
| 768 | |
| 769 | fn sibling_temp_dir(dir: &Path) -> PathBuf { |
| 770 | // Use a sibling so std::fs::rename succeeds (same filesystem). |
no test coverage detected