Skip to content

Commit 24dac77

Browse files
committed
Cargo fmt
1 parent 4eb1ac3 commit 24dac77

File tree

4 files changed

+15
-25
lines changed

4 files changed

+15
-25
lines changed

src/command/build.rs

+7-9
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
use bindgen;
44
use build;
5-
use command::utils::{set_crate_path, create_pkg_dir};
5+
use command::utils::{create_pkg_dir, set_crate_path};
66
use emoji;
77
use error::Error;
88
use indicatif::HumanDuration;
@@ -35,7 +35,7 @@ pub enum BuildMode {
3535
}
3636

3737
/// Everything required to configure and run the `wasm-pack build` command.
38-
#[derive(Debug,StructOpt)]
38+
#[derive(Debug, StructOpt)]
3939
pub struct BuildOptions {
4040
/// The path to the Rust crate.
4141
pub path: Option<String>,
@@ -60,7 +60,6 @@ pub struct BuildOptions {
6060
#[structopt(long = "debug")]
6161
/// Build without --release.
6262
debug: bool,
63-
6463
// build config from manifest
6564
// build_config: Option<BuildConfig>,
6665
}
@@ -72,10 +71,10 @@ impl From<BuildOptions> for Build {
7271
// let build_config = manifest::xxx(&crate_path).xxx();
7372
Build {
7473
crate_path,
75-
scope:build_opts.scope,
76-
disable_dts:build_opts.disable_dts,
77-
target:build_opts.target,
78-
debug:build_opts.debug,
74+
scope: build_opts.scope,
75+
disable_dts: build_opts.disable_dts,
76+
target: build_opts.target,
77+
debug: build_opts.debug,
7978
// build_config,
8079
crate_name,
8180
}
@@ -85,7 +84,7 @@ impl From<BuildOptions> for Build {
8584
type BuildStep = fn(&mut Build, &Step, &Logger) -> Result<(), Error>;
8685

8786
impl Build {
88-
/// Execute this `Init` command.
87+
/// Execute this `Build` command.
8988
pub fn run(&mut self, log: &Logger, mode: BuildMode) -> Result<(), Error> {
9089
let process_steps = Build::get_process_steps(mode);
9190

@@ -148,7 +147,6 @@ impl Build {
148147
}
149148
}
150149

151-
152150
fn step_check_crate_config(&mut self, step: &Step, log: &Logger) -> Result<(), Error> {
153151
info!(&log, "Checking crate configuration...");
154152
manifest::check_crate_config(&self.crate_path, step)?;

src/command/init.rs

+4-12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Initializing a crate for packing `.wasm`s.
22
3-
use command::utils::{set_crate_path,create_pkg_dir};
3+
use command::utils::{create_pkg_dir, set_crate_path};
44
use emoji;
55
use error::Error;
66
use indicatif::HumanDuration;
@@ -17,8 +17,6 @@ pub struct Init {
1717
scope: Option<String>,
1818
disable_dts: bool,
1919
target: String,
20-
// build without --release.
21-
debug: bool,
2220
}
2321

2422
/// `Init` options
@@ -39,22 +37,16 @@ pub struct InitOptions {
3937
#[structopt(long = "target", short = "t", default_value = "browser")]
4038
/// Sets the target environment. [possible values: browser, nodejs]
4139
pub target: String,
42-
43-
#[structopt(long = "debug")]
44-
/// Build without --release.
45-
pub debug: bool,
4640
}
4741

4842
impl From<InitOptions> for Init {
4943
fn from(init_opts: InitOptions) -> Self {
5044
let crate_path = set_crate_path(init_opts.path);
51-
let crate_name = manifest::get_crate_name(&crate_path).unwrap();
52-
Init {
45+
Init {
5346
crate_path,
5447
scope: init_opts.scope,
55-
disable_dts:init_opts.disable_dts,
56-
target:init_opts.target,
57-
debug:init_opts.debug,
48+
disable_dts: init_opts.disable_dts,
49+
target: init_opts.target,
5850
}
5951
}
6052
}

src/command/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ mod pack;
77
mod publish;
88
pub mod utils;
99

10+
use self::build::{Build, BuildMode};
11+
use self::init::Init;
1012
use self::login::login;
1113
use self::pack::pack;
1214
use self::publish::publish;
13-
use self::build::{Build,BuildMode};
14-
use self::init::Init;
1515
use error::Error;
1616
use slog::Logger;
1717
use std::result;

src/command/utils.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
//! Utility functions for commands.
22
3+
use emoji;
34
use error::Error;
45
use progressbar::Step;
5-
use PBAR;
66
use std::fs;
7-
use emoji;
7+
use PBAR;
88

99
/// If an explicit path is given, then use it, otherwise assume the current
1010
/// directory is the crate path.

0 commit comments

Comments
 (0)