diff options
| author | Nick Cameron <ncameron@mozilla.com> | 2017-03-28 10:58:41 +1300 |
|---|---|---|
| committer | Nick Cameron <ncameron@mozilla.com> | 2017-03-28 10:58:41 +1300 |
| commit | e4efa22983a676fc78dafc3d39ff81f062e72120 (patch) | |
| tree | 905ca22de6e7a4a395d7128290b8c71821c93cec /src/bin | |
| parent | 038436919d762bf6fbdd87ce4e824f8c8c0c8822 (diff) | |
Source formatting fallout
Diffstat (limited to 'src/bin')
| -rw-r--r-- | src/bin/cargo-fmt.rs | 9 | ||||
| -rw-r--r-- | src/bin/rustfmt.rs | 9 |
2 files changed, 12 insertions, 6 deletions
diff --git a/src/bin/cargo-fmt.rs b/src/bin/cargo-fmt.rs index ceb6af93825..bd52f11bbef 100644 --- a/src/bin/cargo-fmt.rs +++ b/src/bin/cargo-fmt.rs @@ -96,7 +96,8 @@ fn format_crate(verbosity: Verbosity) -> Result<ExitStatus, std::io::Error> { let targets = try!(get_targets()); // Currently only bin and lib files get formatted - let files: Vec<_> = targets.into_iter() + let files: Vec<_> = targets + .into_iter() .filter(|t| t.kind.should_format()) .inspect(|t| if verbosity == Verbosity::Verbose { println!("[{:?}] {:?}", t.kind, t.path) @@ -165,11 +166,13 @@ fn get_targets() -> Result<Vec<Target>, std::io::Error> { fn target_from_json(jtarget: &Json) -> Target { let jtarget = jtarget.as_object().unwrap(); - let path = PathBuf::from(jtarget.get("src_path") + let path = PathBuf::from(jtarget + .get("src_path") .unwrap() .as_string() .unwrap()); - let kinds = jtarget.get("kind") + let kinds = jtarget + .get("kind") .unwrap() .as_array() .unwrap(); diff --git a/src/bin/rustfmt.rs b/src/bin/rustfmt.rs index e97d0219aad..1a1c0c99de3 100644 --- a/src/bin/rustfmt.rs +++ b/src/bin/rustfmt.rs @@ -226,7 +226,8 @@ fn execute(opts: &Options) -> FmtResult<Summary> { let options = try!(CliOptions::from_matches(&matches)); // Add any additional files that were specified via `--file-lines`. - files.extend(options.file_lines + files.extend(options + .file_lines .files() .cloned() .map(PathBuf::from)); @@ -338,7 +339,8 @@ fn determine_operation(matches: &Matches) -> FmtResult<Operation> { } // Read the config_path and convert to parent dir if a file is provided. - let config_path: Option<PathBuf> = matches.opt_str("config-path") + let config_path: Option<PathBuf> = matches + .opt_str("config-path") .map(PathBuf::from) .and_then(|dir| { if dir.is_file() { @@ -360,7 +362,8 @@ fn determine_operation(matches: &Matches) -> FmtResult<Operation> { } // We append files from `--file-lines` later in `execute()`. - let files: Vec<_> = matches.free + let files: Vec<_> = matches + .free .iter() .map(PathBuf::from) .collect(); |
