From fa07814abf1e950e75a13c2b1c40cf749be09828 Mon Sep 17 00:00:00 2001 From: Zhaofeng Li Date: Fri, 3 Jun 2022 23:51:32 -0700 Subject: [PATCH] hive/assets.rs: Use OpenOptions::new() instead --- src/nix/hive/assets.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nix/hive/assets.rs b/src/nix/hive/assets.rs index 4fc4ab4..5e1e6b3 100644 --- a/src/nix/hive/assets.rs +++ b/src/nix/hive/assets.rs @@ -5,7 +5,7 @@ //! to ease distribution. The files are written to a temporary path when //! we need to use them. -use std::fs::File; +use std::fs::OpenOptions; use std::io::Write; use std::os::unix::fs::OpenOptionsExt; @@ -70,7 +70,7 @@ impl Assets { fn create_file(base: &TempDir, name: &str, executable: bool, contents: &[u8]) { let mode = if executable { 0o700 } else { 0o600 }; let path = base.path().join(name); - let mut f = File::options() + let mut f = OpenOptions::new() .create_new(true) .write(true) .mode(mode)