Skip to content

Commit 0a61662

Browse files
committed
cmd(init/build): cargo clippy
1 parent edbd6f4 commit 0a61662

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/command/build.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ type BuildStep = fn(&mut Build, &Step, &Logger) -> Result<(), Error>;
8383

8484
impl Build {
8585
/// Execute this `Build` command.
86-
pub fn run(&mut self, log: &Logger, mode: BuildMode) -> Result<(), Error> {
86+
pub fn run(&mut self, log: &Logger, mode: &BuildMode) -> Result<(), Error> {
8787
let process_steps = Build::get_process_steps(mode);
8888

8989
let mut step_counter = Step::new(process_steps.len());
@@ -112,7 +112,7 @@ impl Build {
112112
Ok(())
113113
}
114114

115-
fn get_process_steps(mode: BuildMode) -> Vec<(&'static str, BuildStep)> {
115+
fn get_process_steps(mode: &BuildMode) -> Vec<(&'static str, BuildStep)> {
116116
macro_rules! steps {
117117
($($name:ident),+) => {
118118
{
@@ -123,7 +123,7 @@ impl Build {
123123
};
124124
($($name:ident,)*) => (steps![$($name),*])
125125
}
126-
match mode {
126+
match &mode {
127127
BuildMode::Normal => steps![
128128
step_check_crate_config,
129129
step_add_wasm_target,

src/command/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ mod pack;
77
mod publish;
88
pub mod utils;
99

10-
use self::build::{Build, BuildMode};
11-
use self::init::Init;
10+
use self::build::{Build, BuildMode, BuildOptions};
11+
use self::init::{Init, InitOptions};
1212
use self::login::login;
1313
use self::pack::pack;
1414
use self::publish::publish;
@@ -23,11 +23,11 @@ use PBAR;
2323
pub enum Command {
2424
#[structopt(name = "init")]
2525
/// 🐣 initialize a package.json based on your compiled wasm!
26-
Init(init::InitOptions),
26+
Init(InitOptions),
2727

28-
/// build
28+
/// 🏗️ build your npm package!
2929
#[structopt(name = "build")]
30-
Build(self::build::BuildOptions),
30+
Build(BuildOptions),
3131

3232
#[structopt(name = "pack")]
3333
/// 🍱 create a tar of your npm package but don't publish!
@@ -94,7 +94,7 @@ pub fn run_wasm_pack(command: Command, log: &Logger) -> result::Result<(), Error
9494
"normal" => BuildMode::Normal,
9595
_ => BuildMode::Normal,
9696
};
97-
Build::from(build_opts).run(&log, build_mode)
97+
Build::from(build_opts).run(&log, &build_mode)
9898
}
9999
Command::Pack { path } => {
100100
info!(&log, "Running pack command...");

0 commit comments

Comments
 (0)