From 897c48b55f6dfb5d6c1ca14bc022f6c169d62770 Mon Sep 17 00:00:00 2001 From: Erica Marigold Date: Thu, 12 Oct 2023 04:41:13 -0700 Subject: [PATCH] refactor: shorten trait bound declarations --- src/lune/builtins/serde/crypto.rs | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/src/lune/builtins/serde/crypto.rs b/src/lune/builtins/serde/crypto.rs index 245cb82..098ccb2 100644 --- a/src/lune/builtins/serde/crypto.rs +++ b/src/lune/builtins/serde/crypto.rs @@ -28,10 +28,7 @@ pub enum CryptoAlgo { } impl Crypto { - pub fn sha1(content: Option) -> CryptoResult - where - T: ToString, - { + pub fn sha1(content: Option) -> CryptoResult { let content = content.map(|data| data.to_string()); CryptoResult { @@ -41,10 +38,7 @@ impl Crypto { } } - pub fn sha256(content: Option) -> CryptoResult - where - T: ToString, - { + pub fn sha256(content: Option) -> CryptoResult { let content = content.map(|data| data.to_string()); CryptoResult { @@ -54,10 +48,7 @@ impl Crypto { } } - pub fn sha512(content: Option) -> CryptoResult - where - T: ToString, - { + pub fn sha512(content: Option) -> CryptoResult { let content = content.map(|data| data.to_string()); CryptoResult { @@ -67,10 +58,10 @@ impl Crypto { } } - pub fn hmac(content: Option, algo: CryptoAlgo) -> CryptoResult - where - T: ToString, - { + pub fn hmac( + content: Option, + algo: CryptoAlgo, + ) -> CryptoResult { let content = content.map(|data| data.to_string()); CryptoResult {