From 254fc50bc14d83c54283220ed39e33ce06241eef Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Thu, 21 May 2020 11:32:12 +0200 Subject: [PATCH] fmt --- cargo-miri/bin.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/cargo-miri/bin.rs b/cargo-miri/bin.rs index 2e2d4ce956b1..4974ef63f5db 100644 --- a/cargo-miri/bin.rs +++ b/cargo-miri/bin.rs @@ -1,12 +1,12 @@ #![feature(inner_deref)] use std::env; +use std::ffi::OsString; use std::fs::{self, File}; use std::io::{self, BufRead, Write}; use std::ops::Not; use std::path::{Path, PathBuf}; use std::process::Command; -use std::ffi::OsString; use rustc_version::VersionMeta; @@ -265,7 +265,8 @@ fn setup(subcommand: MiriCommand) { let sysroot = std::str::from_utf8(&sysroot).unwrap(); let sysroot = Path::new(sysroot.trim_end_matches('\n')); // Check for `$SYSROOT/lib/rustlib/src/rust/src`; test if that contains `libstd/lib.rs`. - let rustup_src = sysroot.join("lib").join("rustlib").join("src").join("rust").join("src"); + let rustup_src = + sysroot.join("lib").join("rustlib").join("src").join("rust").join("src"); if !rustup_src.join("libstd").join("lib.rs").exists() { // Ask the user to install the `rust-src` component, and use that. let mut cmd = Command::new("rustup"); @@ -363,8 +364,7 @@ path = "lib.rs" let sysroot = if target == &host { dir.join("HOST") } else { PathBuf::from(dir) }; std::env::set_var("MIRI_SYSROOT", &sysroot); // pass the env var to the processes we spawn, which will turn it into "--sysroot" flags // Figure out what to print. - let print_sysroot = subcommand == MiriCommand::Setup - && has_arg_flag("--print-sysroot"); // whether we just print the sysroot path + let print_sysroot = subcommand == MiriCommand::Setup && has_arg_flag("--print-sysroot"); // whether we just print the sysroot path if print_sysroot { // Print just the sysroot and nothing else; this way we do not need any escaping. println!("{}", sysroot.display()); @@ -564,6 +564,8 @@ fn main() { // dependencies get dispatched to `rustc`, the final test/binary to `miri`. inside_cargo_rustc(); } else { - show_error(format!("`cargo-miri` must be called with either `miri` or `rustc` as first argument.")) + show_error(format!( + "`cargo-miri` must be called with either `miri` or `rustc` as first argument." + )) } }