Skip to content

Commit 27883d5

Browse files
committed
cmd(snip): format
1 parent c94efd7 commit 27883d5

File tree

3 files changed

+16
-18
lines changed

3 files changed

+16
-18
lines changed

src/command.rs

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ use slog::Logger;
1414
use std::fs;
1515
use std::result;
1616
use std::time::Instant;
17-
use PBAR;
1817
use wasm_snip;
18+
use PBAR;
1919

2020
#[derive(Debug, StructOpt)]
2121
pub enum Command {
@@ -84,16 +84,16 @@ pub enum Command {
8484

8585
#[derive(Clone, Debug, StructOpt)]
8686
pub struct SnipOpitons {
87-
input: String,
88-
#[structopt(long = "output", short = "o")]
89-
pub(crate) output: Option<String>,
90-
functions: Vec<String>,
91-
#[structopt(long = "pattern", short = "p")]
92-
patterns: Vec<String>,
93-
#[structopt(long = "snip_rust_fmt_code")]
94-
snip_rust_fmt_code: bool,
95-
#[structopt(long = "snip_rust_panicking_code")]
96-
snip_rust_panicking_code: bool,
87+
input: String,
88+
#[structopt(long = "output", short = "o")]
89+
pub(crate) output: Option<String>,
90+
functions: Vec<String>,
91+
#[structopt(long = "pattern", short = "p")]
92+
patterns: Vec<String>,
93+
#[structopt(long = "snip_rust_fmt_code")]
94+
snip_rust_fmt_code: bool,
95+
#[structopt(long = "snip_rust_panicking_code")]
96+
snip_rust_panicking_code: bool,
9797
}
9898

9999
impl Into<wasm_snip::Options> for SnipOpitons {
@@ -158,10 +158,9 @@ pub fn run_wasm_pack(command: Command, log: &Logger) -> result::Result<(), Error
158158
}
159159

160160
Command::Snip(opts) => {
161-
info!(&log, "Running snip command...");
161+
info!(&log, "Running snip command...");
162162
snip(opts)
163163
}
164-
165164
};
166165

167166
match status {
@@ -354,7 +353,7 @@ fn set_crate_path(path: Option<String>) -> String {
354353

355354
fn snip(opts: SnipOpitons) -> Result<(), Error> {
356355
let opt = opts.clone();
357-
let module = wasm_snip::snip(opts.into())?;
356+
let module = wasm_snip::snip(opts.into())?;
358357

359358
if let Some(output) = opt.output {
360359
elements::serialize_to_file(output, module)?;

src/error.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
//! Code related to error handling for wasm-pack
2-
use serde_json;
2+
use failure;
33
use parity_wasm;
4+
use serde_json;
45
use std::borrow::Cow;
56
use std::io;
67
use toml;
7-
use failure;
88

99
#[derive(Debug, Fail)]
1010
pub enum Error {
@@ -86,4 +86,3 @@ impl From<failure::Error> for Error {
8686
}
8787
}
8888
}
89-

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ extern crate serde_json;
1212
extern crate structopt;
1313
#[macro_use]
1414
extern crate slog;
15+
extern crate parity_wasm;
1516
extern crate slog_async;
1617
extern crate slog_term;
1718
extern crate toml;
1819
extern crate wasm_snip;
19-
extern crate parity_wasm;
2020

2121
pub mod bindgen;
2222
pub mod build;

0 commit comments

Comments
 (0)