Skip to content

Commit 7dbea0c

Browse files
jschwesylvestre
authored andcommitted
Fix clippy lints
All pretty straight forward. mod.rs in tests/harness should probably be refactored at some point to actually check all the possible errors and not just drop results, as is common there. Signed-off-by: Jonathan Schwender <[email protected]>
1 parent 764c479 commit 7dbea0c

File tree

5 files changed

+8
-6
lines changed

5 files changed

+8
-6
lines changed

src/compiler/args.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,7 @@ macro_rules! ArgData {
307307
};
308308
{ $( $tok:tt )+ } => {
309309
#[derive(Clone, Debug, PartialEq)]
310+
#[allow(clippy::enum_variant_names)]
310311
enum ArgData {
311312
$($tok)+
312313
}

src/compiler/msvc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ pub fn parse_arguments(
581581
let arg = try_or_cannot_cache!(arg, "argument parse");
582582
// Eagerly bail if it looks like we need to do more complicated work
583583
use crate::compiler::gcc::ArgData::*;
584-
let mut args = match arg.get_data() {
584+
let args = match arg.get_data() {
585585
Some(SplitDwarf) | Some(TestCoverage) | Some(Coverage) | Some(DoCompilation)
586586
| Some(Language(_)) | Some(Output(_)) | Some(TooHardFlag) | Some(XClang(_))
587587
| Some(TooHard(_)) => cannot_cache!(arg
@@ -621,7 +621,7 @@ pub fn parse_arguments(
621621
_ => NormalizedDisposition::Separated,
622622
};
623623
for arg in arg.normalize(norm).iter_os_strings() {
624-
append_fn(arg, &mut args);
624+
append_fn(arg, args);
625625
}
626626
}
627627
}

src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ impl CacheConfigs {
247247
.chain(gcs.map(CacheType::GCS))
248248
.chain(azure.map(CacheType::Azure))
249249
.collect();
250-
let fallback = disk.unwrap_or_else(Default::default);
250+
let fallback = disk.unwrap_or_default();
251251

252252
(caches, fallback)
253253
}

src/simples3/s3.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,13 +195,14 @@ impl Bucket {
195195
creds: &AwsCredentials,
196196
) -> String {
197197
let string = format!(
198-
"{verb}\n{md5}\n{ty}\n{date}\n{headers}{resource}",
198+
"{verb}\n{md5}\n{ty}\n{date}\n{headers}/{name}/{path}",
199199
verb = verb,
200200
md5 = md5,
201201
ty = content_type,
202202
date = date,
203203
headers = headers,
204-
resource = format!("/{}/{}", self.name, path)
204+
name = self.name,
205+
path = path,
205206
);
206207
let signature = signature(&string, creds.aws_secret_access_key());
207208
format!("AWS {}:{}", creds.aws_access_key_id(), signature)

tests/harness/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const TC_CACHE_SIZE: u64 = 1024 * 1024 * 1024; // 1 gig
5353
pub fn start_local_daemon(cfg_path: &Path, cached_cfg_path: &Path) {
5454
// Don't run this with run() because on Windows `wait_with_output`
5555
// will hang because the internal server process is not detached.
56-
sccache_command()
56+
let _ = sccache_command()
5757
.arg("--start-server")
5858
.env("SCCACHE_CONF", cfg_path)
5959
.env("SCCACHE_CACHED_CONF", cached_cfg_path)

0 commit comments

Comments
 (0)