Skip to content

Commit 195f9a3

Browse files
run cargo fmt
1 parent 217f861 commit 195f9a3

File tree

3 files changed

+28
-15
lines changed

3 files changed

+28
-15
lines changed

src/build/wasm_target.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@ impl fmt::Display for Wasm32Check {
5454
/// Ensure that `rustup` has the `wasm32-unknown-unknown` target installed for
5555
/// current toolchain
5656
pub fn check_for_wasm32_target(target_triple: String) -> Result<()> {
57-
let msg = format!("{}Checking for the Wasm target {}...", emoji::TARGET, target_triple);
57+
let msg = format!(
58+
"{}Checking for the Wasm target {}...",
59+
emoji::TARGET,
60+
target_triple
61+
);
5862
PBAR.info(&msg);
5963

6064
// Check if wasm32 target is present, otherwise bail.
@@ -109,17 +113,12 @@ fn does_wasm32_target_libdir_exist(target_triple: String) -> bool {
109113
match result {
110114
Ok(wasm32_target_libdir_path) => {
111115
if wasm32_target_libdir_path.exists() {
112-
info!(
113-
"Found {} in {:?}",
114-
target_triple,
115-
wasm32_target_libdir_path
116-
);
116+
info!("Found {} in {:?}", target_triple, wasm32_target_libdir_path);
117117
true
118118
} else {
119119
info!(
120120
"Failed to find {} in {:?}",
121-
target_triple,
122-
wasm32_target_libdir_path
121+
target_triple, wasm32_target_libdir_path
123122
);
124123
false
125124
}
@@ -168,7 +167,8 @@ fn check_wasm32_target(target_triple: String) -> Result<Wasm32Check> {
168167
fn rustup_add_wasm_target(target_triple: String) -> Result<()> {
169168
let mut cmd = Command::new("rustup");
170169
cmd.arg("target").arg("add").arg(target_triple.clone());
171-
child::run(cmd, "rustup").context(format!("Adding the {} target with rustup", target_triple))?;
170+
child::run(cmd, "rustup")
171+
.context(format!("Adding the {} target with rustup", target_triple))?;
172172

173173
Ok(())
174174
}

src/command/build.rs

+17-5
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,12 @@ impl Build {
270270

271271
/// Execute this `Build` command.
272272
pub fn run(&mut self) -> Result<()> {
273-
let process_steps = Build::get_process_steps(self.mode, self.no_pack, self.no_opt, self.crate_data.get_target_triple());
273+
let process_steps = Build::get_process_steps(
274+
self.mode,
275+
self.no_pack,
276+
self.no_opt,
277+
self.crate_data.get_target_triple(),
278+
);
274279

275280
let started = Instant::now();
276281

@@ -299,7 +304,7 @@ impl Build {
299304
mode: InstallMode,
300305
no_pack: bool,
301306
no_opt: bool,
302-
target_triple: String
307+
target_triple: String,
303308
) -> Vec<(&'static str, BuildStep)> {
304309
macro_rules! steps {
305310
($($name:ident),+) => {
@@ -330,7 +335,7 @@ impl Build {
330335
step_create_dir,
331336
step_copy_emscripten_outputs,
332337
]);
333-
} else {
338+
} else {
334339
steps.extend(steps![
335340
step_build_wasm,
336341
step_create_dir,
@@ -378,7 +383,12 @@ impl Build {
378383

379384
fn step_build_wasm(&mut self) -> Result<()> {
380385
info!("Building wasm...");
381-
build::cargo_build_wasm(&self.crate_path, self.profile.clone(), self.crate_data.get_target_triple(), &self.extra_options)?;
386+
build::cargo_build_wasm(
387+
&self.crate_path,
388+
self.profile.clone(),
389+
self.crate_data.get_target_triple(),
390+
&self.extra_options,
391+
)?;
382392

383393
info!(
384394
"wasm built at {:#?}.",
@@ -476,7 +486,9 @@ impl Build {
476486
BuildProfile::Custom(profile_name) => &profile_name.clone(),
477487
};
478488

479-
let wasm_path = self.crate_data.target_directory()
489+
let wasm_path = self
490+
.crate_data
491+
.target_directory()
480492
.join(self.crate_data.get_target_triple())
481493
.join(profile_name)
482494
.join(self.crate_data.crate_name());

src/manifest/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,8 @@ impl CrateData {
600600
"crate-type must be cdylib to compile to {}. Add the following to your \
601601
Cargo.toml file:\n\n\
602602
[lib]\n\
603-
crate-type = [\"cdylib\", \"rlib\"]", &self.target_triple
603+
crate-type = [\"cdylib\", \"rlib\"]",
604+
&self.target_triple
604605
)
605606
}
606607

0 commit comments

Comments
 (0)