feat(build): Use RUSTFMT to find rustfmt binary (#566)
This commit is contained in:
@@ -165,13 +165,14 @@ pub fn fmt(out_dir: &str) {
|
|||||||
if !file.ends_with(".rs") {
|
if !file.ends_with(".rs") {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
let result = Command::new("rustfmt")
|
let result =
|
||||||
.arg("--emit")
|
Command::new(std::env::var("RUSTFMT").unwrap_or_else(|_| "rustfmt".to_owned()))
|
||||||
.arg("files")
|
.arg("--emit")
|
||||||
.arg("--edition")
|
.arg("files")
|
||||||
.arg("2018")
|
.arg("--edition")
|
||||||
.arg(format!("{}/{}", out_dir, file))
|
.arg("2018")
|
||||||
.output();
|
.arg(format!("{}/{}", out_dir, file))
|
||||||
|
.output();
|
||||||
|
|
||||||
match result {
|
match result {
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user