Skip to content

Commit 1576fc1

Browse files
committed
Rename step variable
1 parent f75099e commit 1576fc1

File tree

1 file changed

+21
-20
lines changed

1 file changed

+21
-20
lines changed

src/command.rs

+21-20
Original file line numberDiff line numberDiff line change
@@ -195,29 +195,30 @@ impl Init {
195195
}
196196

197197
pub fn process(&mut self, log: &Logger, mode: InitMode) -> result::Result<(), Error> {
198-
let steps: Vec<fn(&mut Init, &Step, &Logger) -> result::Result<(), Error>> = match mode {
199-
InitMode::Normal => vec![
200-
Init::step_add_wasm_target,
201-
Init::step_build_wasm,
202-
Init::step_create_dir,
203-
Init::step_create_json,
204-
Init::step_copy_readme,
205-
Init::step_install_wasm_bindgen,
206-
Init::step_running_wasm_bindgen,
207-
],
208-
InitMode::Nobuild => vec![
209-
Init::step_create_dir,
210-
Init::step_create_json,
211-
Init::step_copy_readme,
212-
],
213-
};
214-
let mut step = Step::new(steps.len());
198+
let process_steps: Vec<fn(&mut Init, &Step, &Logger) -> result::Result<(), Error>> =
199+
match mode {
200+
InitMode::Normal => vec![
201+
Init::step_add_wasm_target,
202+
Init::step_build_wasm,
203+
Init::step_create_dir,
204+
Init::step_create_json,
205+
Init::step_copy_readme,
206+
Init::step_install_wasm_bindgen,
207+
Init::step_running_wasm_bindgen,
208+
],
209+
InitMode::Nobuild => vec![
210+
Init::step_create_dir,
211+
Init::step_create_json,
212+
Init::step_copy_readme,
213+
],
214+
};
215+
let mut step_counter = Step::new(process_steps.len());
215216

216217
let started = Instant::now();
217218

218-
for s in steps {
219-
s(self, &step, log)?;
220-
step.inc();
219+
for process_step in process_steps {
220+
process_step(self, &step_counter, log)?;
221+
step_counter.inc();
221222
}
222223

223224
let duration = HumanDuration(started.elapsed());

0 commit comments

Comments
 (0)