Skip to content

Commit 49756da

Browse files
authored
Merge pull request #23 from jgarzik/clippy
clippy cleanups
2 parents 305f3c9 + b99dccc commit 49756da

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

src/main.rs

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ fn sign_server_csr(
330330
)?;
331331

332332
// Sign the certificate with the CA's private key
333-
builder.sign(&ca_pkey, openssl::hash::MessageDigest::sha256())?;
333+
builder.sign(ca_pkey, openssl::hash::MessageDigest::sha256())?;
334334

335335
Ok(builder.build())
336336
}
@@ -360,7 +360,7 @@ fn write_outputs_zip(
360360
} else {
361361
zip.start_file(&output.filename, options)?;
362362
}
363-
zip.write(&output.data)?;
363+
zip.write_all(&output.data)?;
364364
}
365365

366366
zip.finish()?;
@@ -372,12 +372,10 @@ fn write_outputs(outputs: &Vec<FileOutput>) -> Result<(), std::io::Error> {
372372
for output in outputs {
373373
#[cfg(unix)]
374374
{
375-
let fmode;
376-
if output.is_key {
377-
fmode = MODE_KEY;
378-
} else {
379-
fmode = MODE_NORMAL;
380-
}
375+
let fmode = match output.is_key {
376+
true => MODE_KEY,
377+
false => MODE_NORMAL,
378+
};
381379

382380
let mut file = OpenOptions::new()
383381
.write(true)
@@ -443,7 +441,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
443441
// Output root CA privkey PEM
444442
push_output(
445443
&mut outputs,
446-
&basepath,
444+
basepath,
447445
&args.ca_key_out,
448446
&ca_key.private_key_to_pem_pkcs8()?,
449447
true,
@@ -452,7 +450,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
452450
// Output root CA cert PEM
453451
push_output(
454452
&mut outputs,
455-
&basepath,
453+
basepath,
456454
&args.ca_cert_out,
457455
&ca_cert.to_pem()?,
458456
false,
@@ -461,7 +459,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
461459
// Output server privkey PEM
462460
push_output(
463461
&mut outputs,
464-
&basepath,
462+
basepath,
465463
&args.key_out,
466464
&server_key.private_key_to_pem_pkcs8()?,
467465
true,
@@ -471,7 +469,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
471469
if args.csr_out.is_some() {
472470
push_output(
473471
&mut outputs,
474-
&basepath,
472+
basepath,
475473
&args.csr_out.unwrap(),
476474
&server_csr.to_pem()?,
477475
false,
@@ -481,7 +479,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
481479
// Output server cert PEM
482480
push_output(
483481
&mut outputs,
484-
&basepath,
482+
basepath,
485483
&args.cert_out,
486484
&server_cert.to_pem()?,
487485
false,

0 commit comments

Comments
 (0)