зеркало из https://github.com/mozilla/sccache.git
Misc simplifcations
This commit is contained in:
Родитель
59df6e49ec
Коммит
8ac19f2af7
|
@ -143,7 +143,7 @@ pub fn parse() -> Result<Command> {
|
||||||
stop_server,
|
stop_server,
|
||||||
is_some(&cmd),
|
is_some(&cmd),
|
||||||
].iter()
|
].iter()
|
||||||
.fold(0, |acc, &x| acc + (x as usize)) > 1 {
|
.filter(|&&x| x).count() > 1 {
|
||||||
bail!("Too many commands specified");
|
bail!("Too many commands specified");
|
||||||
}
|
}
|
||||||
if internal_start_server {
|
if internal_start_server {
|
||||||
|
|
|
@ -150,9 +150,8 @@ pub trait CompilerHasher<T>: fmt::Debug + Send + 'static
|
||||||
// Check the result of the cache lookup.
|
// Check the result of the cache lookup.
|
||||||
Box::new(cache_status.then(move |result| {
|
Box::new(cache_status.then(move |result| {
|
||||||
let duration = start.elapsed();
|
let duration = start.elapsed();
|
||||||
let pwd = Path::new(&cwd);
|
|
||||||
let outputs = compilation.outputs()
|
let outputs = compilation.outputs()
|
||||||
.map(|(key, path)| (key.to_string(), pwd.join(path)))
|
.map(|(key, path)| (key.to_string(), cwd.join(path)))
|
||||||
.collect::<HashMap<_, _>>();
|
.collect::<HashMap<_, _>>();
|
||||||
|
|
||||||
let miss_type = match result {
|
let miss_type = match result {
|
||||||
|
@ -213,7 +212,6 @@ pub trait CompilerHasher<T>: fmt::Debug + Send + 'static
|
||||||
|
|
||||||
// Cache miss, so compile it.
|
// Cache miss, so compile it.
|
||||||
let start = Instant::now();
|
let start = Instant::now();
|
||||||
let out_pretty = out_pretty.clone();
|
|
||||||
let compile = compilation.compile(&creator, &cwd, &env_vars);
|
let compile = compilation.compile(&creator, &cwd, &env_vars);
|
||||||
Box::new(compile.and_then(move |(cacheable, compiler_result)| {
|
Box::new(compile.and_then(move |(cacheable, compiler_result)| {
|
||||||
let duration = start.elapsed();
|
let duration = start.elapsed();
|
||||||
|
@ -255,7 +253,6 @@ pub trait CompilerHasher<T>: fmt::Debug + Send + 'static
|
||||||
|
|
||||||
// Try to finish storing the newly-written cache
|
// Try to finish storing the newly-written cache
|
||||||
// entry. We'll get the result back elsewhere.
|
// entry. We'll get the result back elsewhere.
|
||||||
let out_pretty = out_pretty.clone();
|
|
||||||
let future = storage.put(&key, entry)
|
let future = storage.put(&key, entry)
|
||||||
.then(move |res| {
|
.then(move |res| {
|
||||||
match res {
|
match res {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче