This commit is contained in:
Aidan Hobson Sayers 2018-04-11 09:54:43 +01:00 коммит произвёл Ted Mielczarek
Родитель 59df6e49ec
Коммит 8ac19f2af7
2 изменённых файлов: 2 добавлений и 5 удалений

Просмотреть файл

@ -143,7 +143,7 @@ pub fn parse() -> Result<Command> {
stop_server,
is_some(&cmd),
].iter()
.fold(0, |acc, &x| acc + (x as usize)) > 1 {
.filter(|&&x| x).count() > 1 {
bail!("Too many commands specified");
}
if internal_start_server {

Просмотреть файл

@ -150,9 +150,8 @@ pub trait CompilerHasher<T>: fmt::Debug + Send + 'static
// Check the result of the cache lookup.
Box::new(cache_status.then(move |result| {
let duration = start.elapsed();
let pwd = Path::new(&cwd);
let outputs = compilation.outputs()
.map(|(key, path)| (key.to_string(), pwd.join(path)))
.map(|(key, path)| (key.to_string(), cwd.join(path)))
.collect::<HashMap<_, _>>();
let miss_type = match result {
@ -213,7 +212,6 @@ pub trait CompilerHasher<T>: fmt::Debug + Send + 'static
// Cache miss, so compile it.
let start = Instant::now();
let out_pretty = out_pretty.clone();
let compile = compilation.compile(&creator, &cwd, &env_vars);
Box::new(compile.and_then(move |(cacheable, compiler_result)| {
let duration = start.elapsed();
@ -255,7 +253,6 @@ pub trait CompilerHasher<T>: fmt::Debug + Send + 'static
// Try to finish storing the newly-written cache
// entry. We'll get the result back elsewhere.
let out_pretty = out_pretty.clone();
let future = storage.put(&key, entry)
.then(move |res| {
match res {