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:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user