Skip to content
This repository was archived by the owner on Nov 28, 2023. It is now read-only.

Commit e969c07

Browse files
committed
Use std::fs::write in build.rs
1 parent 748ef45 commit e969c07

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

build.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ extern crate riscv_target;
44
use riscv_target::Target;
55
use std::env;
66
use std::fs;
7-
use std::io::Write;
87
use std::path::PathBuf;
98

109
fn main() {
@@ -29,10 +28,7 @@ fn main() {
2928
}
3029

3130
// Put the linker script somewhere the linker can find it
32-
fs::File::create(out_dir.join("link.x"))
33-
.unwrap()
34-
.write_all(include_bytes!("link.x"))
35-
.unwrap();
31+
fs::write(out_dir.join("link.x"), include_bytes!("link.x")).unwrap();
3632
println!("cargo:rustc-link-search={}", out_dir.display());
3733

3834
println!("cargo:rerun-if-changed=build.rs");

0 commit comments

Comments
 (0)