Skip to content

Commit d4bf8c9

Browse files
committed
Run rustfmt
1 parent 42db812 commit d4bf8c9

File tree

8 files changed

+25
-30
lines changed

8 files changed

+25
-30
lines changed

src/config.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use serde_json;
21
use cargo_metadata;
2+
use serde_json;
33
use std::path::PathBuf;
44

55
#[derive(Debug, Hash)]
@@ -17,7 +17,9 @@ struct ParseConfig {
1717
impl Config {
1818
pub fn from_metadata(metadata: &cargo_metadata::Metadata) -> Result<Config, serde_json::Error> {
1919
let package_metadata = metadata.packages.first().map(|p| &p.metadata);
20-
let crate_metadata = package_metadata.as_ref().and_then(|m| m.get("cargo-xbuild"));
20+
let crate_metadata = package_metadata
21+
.as_ref()
22+
.and_then(|m| m.get("cargo-xbuild"));
2123
let config = match crate_metadata {
2224
Some(json) => serde_json::from_value(json.clone())?,
2325
None => ParseConfig::default(),

src/extensions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use std::io::Write;
21
use std::io;
2+
use std::io::Write;
33
use std::process::{Command, ExitStatus};
44

55
use errors::*;

src/flock.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ use std::io::Write;
66
use std::path::{Display, Path, PathBuf};
77
use std::{fs, io};
88

9-
use fs2::FileExt;
109
use fs2;
10+
use fs2::FileExt;
1111

1212
#[derive(PartialEq)]
1313
enum State {

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ use rustc::Target;
2525

2626
mod cargo;
2727
mod cli;
28+
mod config;
2829
mod errors;
2930
mod extensions;
3031
mod flock;
3132
mod rustc;
3233
mod sysroot;
3334
mod util;
3435
mod xargo;
35-
mod config;
3636

3737
const HELP: &str = include_str!("help.txt");
3838

src/rustc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ use std::process::Command;
66

77
pub use rustc_version::version_meta as version;
88

9-
use serde_json::Value;
109
use serde_json;
10+
use serde_json::Value;
1111
use walkdir::WalkDir;
1212

13-
use CurrentDirectory;
1413
use errors::*;
1514
use extensions::CommandExt;
15+
use CurrentDirectory;
1616
use {rustc, util};
1717

1818
fn command() -> Command {

src/sysroot.rs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
use std::collections::hash_map::DefaultHasher;
2+
use std::env;
23
use std::hash::{Hash, Hasher};
34
use std::path::Path;
45
use std::process::Command;
5-
use std::env;
66

77
use rustc_version::VersionMeta;
88
use tempdir::TempDir;
99
use toml::{Table, Value};
1010

11-
use CompilationMode;
11+
use cargo;
1212
use cargo::Rustflags;
13+
use config::Config;
1314
use errors::*;
1415
use extensions::CommandExt;
1516
use rustc::{Src, Sysroot, Target};
1617
use util;
1718
use xargo::Home;
18-
use cargo;
19-
use config::Config;
19+
use CompilationMode;
2020

2121
#[cfg(feature = "dev")]
2222
fn profile() -> &'static str {
@@ -187,17 +187,12 @@ version = "0.0.0"
187187
let mut compiler_builtin_dep = Table::new();
188188
compiler_builtin_dep.insert("path".to_owned(), Value::String(path));
189189

190-
let mut features = vec![
191-
Value::String("compiler-builtins".to_owned()),
192-
];
190+
let mut features = vec![Value::String("compiler-builtins".to_owned())];
193191
if config.memcpy {
194192
features.push(Value::String("mem".to_owned()));
195193
}
196194
compiler_builtin_dep.insert("default-features".to_owned(), Value::Boolean(false));
197-
compiler_builtin_dep.insert(
198-
"features".to_owned(),
199-
Value::Array(features),
200-
);
195+
compiler_builtin_dep.insert("features".to_owned(), Value::Array(features));
201196
let mut deps = Table::new();
202197
deps.insert(
203198
"compiler_builtins".to_owned(),

src/util.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
use std::fs;
12
use std::fs::File;
23
use std::io::{Read, Write};
34
use std::path::Path;
4-
use std::fs;
55

66
use toml::{Parser, Value};
77
use walkdir::WalkDir;
@@ -59,11 +59,9 @@ pub fn mkdir(path: &Path) -> Result<()> {
5959

6060
/// Parses `path` as TOML
6161
pub fn parse(path: &Path) -> Result<Value> {
62-
Ok(Value::Table(Parser::new(&read(path)?)
63-
.parse()
64-
.ok_or_else(|| {
65-
format!("{} is not valid TOML", path.display())
66-
})?))
62+
Ok(Value::Table(Parser::new(&read(path)?).parse().ok_or_else(
63+
|| format!("{} is not valid TOML", path.display()),
64+
)?))
6765
}
6866

6967
pub fn read(path: &Path) -> Result<String> {
@@ -120,4 +118,4 @@ pub fn escape_argument_spaces<S: Into<String>>(arg: S) -> String {
120118
*/
121119

122120
escaped
123-
}
121+
}

src/xargo.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
use std::path::{Display, PathBuf};
2-
use std::process::{Command, ExitStatus};
3-
use std::mem;
41
use std::io::{self, Write};
2+
use std::mem;
53
use std::path::Path;
4+
use std::path::{Display, PathBuf};
5+
use std::process::{Command, ExitStatus};
66

77
use rustc_version::VersionMeta;
88

9-
use CompilationMode;
109
use cargo::Rustflags;
1110
use cli::Args;
11+
use config::Config;
1212
use errors::*;
1313
use extensions::CommandExt;
1414
use flock::{FileLock, Filesystem};
15-
use config::Config;
15+
use CompilationMode;
1616

1717
pub fn run(
1818
args: &Args,

0 commit comments

Comments
 (0)