From 2d10ddb9fa524a73d49d231e70594ff3d8651f72 Mon Sep 17 00:00:00 2001 From: Kitaiti Makoto Date: Thu, 5 Jan 2023 02:33:29 +0900 Subject: [PATCH] Clippy --- plume-common/src/activity_pub/inbox.rs | 6 +++--- plume-common/src/activity_pub/request.rs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plume-common/src/activity_pub/inbox.rs b/plume-common/src/activity_pub/inbox.rs index e2a769ee..e8d36ccb 100644 --- a/plume-common/src/activity_pub/inbox.rs +++ b/plume-common/src/activity_pub/inbox.rs @@ -561,7 +561,7 @@ mod tests { use once_cell::sync::Lazy; use openssl::{hash::MessageDigest, pkey::PKey, rsa::Rsa}; - static MY_SIGNER: Lazy = Lazy::new(|| MySigner::new()); + static MY_SIGNER: Lazy = Lazy::new(MySigner::new); struct MySigner { public_key: String, @@ -596,7 +596,7 @@ mod tests { .unwrap(); let mut verifier = openssl::sign::Verifier::new(MessageDigest::sha256(), &key).unwrap(); verifier.update(data.as_bytes()).unwrap(); - verifier.verify(&signature).map_err(|_| SignError()) + verifier.verify(signature).map_err(|_| SignError()) } } @@ -782,7 +782,7 @@ mod tests { .done(); assert!(res.is_err()); - let res: Result<(), ()> = Inbox::handle(&(), act.clone()) + let res: Result<(), ()> = Inbox::handle(&(), act) .with::(None) .with::(None) .done(); diff --git a/plume-common/src/activity_pub/request.rs b/plume-common/src/activity_pub/request.rs index 3d60b820..4d5a4097 100644 --- a/plume-common/src/activity_pub/request.rs +++ b/plume-common/src/activity_pub/request.rs @@ -253,7 +253,7 @@ mod tests { .unwrap(); let mut verifier = openssl::sign::Verifier::new(MessageDigest::sha256(), &key).unwrap(); verifier.update(data.as_bytes()).unwrap(); - verifier.verify(&signature).map_err(|_| Error()) + verifier.verify(signature).map_err(|_| Error()) } } @@ -262,7 +262,7 @@ mod tests { let signer = MySigner::new(); let headers = HeaderMap::new(); let result = signature(&signer, &headers, ("post", "/inbox", None)).unwrap(); - let fields: Vec<&str> = result.to_str().unwrap().split(",").collect(); + let fields: Vec<&str> = result.to_str().unwrap().split(',').collect(); assert_eq!(r#"headers="(request-target)""#, fields[2]); let sign = &fields[3][11..(fields[3].len() - 1)]; assert!(signer.verify("post /inbox", sign.as_bytes()).is_ok());