chore: fix 30 of the 54 warnings from clippy pedantic. (#81)

I just ran `cargo clippy -- -W clippy::pedantic` and fixed things.

These are more invasive that the default set and the remaining
warnings are mostly about our (abysmal) public docs missing
Error and Panic sections to explain errors and panicks.
This commit is contained in:
Eric Seidel
2023-09-08 10:51:07 -07:00
committed by GitHub
parent 20b65f14c2
commit e4b182d75d
12 changed files with 75 additions and 81 deletions
+5 -4
View File
@@ -1,6 +1,8 @@
// This might combine with patch/main.rs. Just starting with a copy for ease.
fn main() {
use sha2::{Digest, Sha256}; // Digest is needed for Sha256::new();
let mut args = std::env::args();
args.next(); // skip program name
let older = args.next().expect("base string");
@@ -14,13 +16,12 @@ fn main() {
let patch = patch.into_inner();
use sha2::{Digest, Sha256}; // Digest is needed for Sha256::new();
let mut hasher = Sha256::new();
hasher.update(&newer);
let hash = hasher.finalize();
println!("Base: {}", older);
println!("New: {}", newer);
println!("Patch: {:?}", patch);
println!("Base: {older}");
println!("New: {newer}");
println!("Patch: {patch:?}");
println!("Hash (new): {}", hex::encode(hash));
}