Skip to content
This repository was archived by the owner on Jan 9, 2020. It is now read-only.

Commit 888c916

Browse files
author
Vishvananda Ishaya Abrams
committed
formatting
1 parent 888091e commit 888c916

File tree

3 files changed

+17
-10
lines changed

3 files changed

+17
-10
lines changed

build.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ fn main() {
99
let mut cmd = Command::new("./build_seccomp.sh");
1010
let output = cmd.output().expect("cmd failed to start");
1111
if !output.status.success() {
12-
println!("failed to build libseccomp:\n{}\n{}",
13-
&std::str::from_utf8(&output.stdout).unwrap(),
14-
&std::str::from_utf8(&output.stderr).unwrap());
12+
println!(
13+
"failed to build libseccomp:\n{}\n{}",
14+
&std::str::from_utf8(&output.stdout).unwrap(),
15+
&std::str::from_utf8(&output.stderr).unwrap()
16+
);
1517
let mut f = File::open("libseccomp/config.log").unwrap();
1618
let mut result = String::new();
1719
f.read_to_string(&mut result).unwrap();
@@ -25,4 +27,3 @@ fn main() {
2527
println!("cargo:rustc-link-lib=static=seccomp");
2628
}
2729
}
28-

src/logger.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ impl Log for SimpleLogger {
1010

1111
fn log(&self, record: &LogRecord) {
1212
if self.enabled(record.metadata()) {
13-
let _ = writeln!(&mut stderr(), "{} - {}",
14-
record.level(), record.args());
13+
let _ = writeln!(
14+
&mut stderr(),
15+
"{} - {}",
16+
record.level(),
17+
record.args()
18+
);
1519
}
1620
}
1721
}

src/main.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,9 @@ fn run() -> Result<()> {
304304
if id.contains("..") || id.contains('/') {
305305
bail!("id {} may cannot contain '..' or '/'", id);
306306
}
307-
let state_dir = matches.opt_str("r")
308-
.unwrap_or_else(|| "/run/railcar".to_string());
307+
let state_dir = matches.opt_str("r").unwrap_or_else(
308+
|| "/run/railcar".to_string(),
309+
);
309310
debug!("ensuring railcar state dir {}", &state_dir);
310311
let chain = || format!("ensuring railcar state dir {} failed", &state_dir);
311312
create_dir_all(&state_dir).chain_err(chain)?;
@@ -489,8 +490,9 @@ fn cmd_create(
489490
windows: spec.windows,
490491
};
491492
debug!("writing updated config");
492-
updated.save(CONFIG)
493-
.chain_err(|| format!("failed to save {}", CONFIG))?;
493+
updated.save(CONFIG).chain_err(
494+
|| format!("failed to save {}", CONFIG),
495+
)?;
494496
}
495497
Ok(())
496498
}

0 commit comments

Comments
 (0)