Skip to content

Commit 4d5c7ae

Browse files
author
Bennett Hardwick
committed
Fmt and clip
1 parent 6fec90b commit 4d5c7ae

File tree

4 files changed

+4
-6
lines changed

4 files changed

+4
-6
lines changed

cryptonamo-derive/src/encryptable.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ pub(crate) fn derive_encryptable(input: DeriveInput) -> Result<TokenStream, syn:
108108
vec![#(#plaintext_attributes,)*]
109109
}
110110

111+
#[allow(clippy::needless_question_mark)]
111112
fn into_sealer(self) -> Result<cryptonamo::crypto::Sealer<Self>, cryptonamo::crypto::SealError> {
112113
Ok(cryptonamo::crypto::Sealer::new_with_descriptor(self, Self::type_name())
113114
#(#into_unsealed_impl?)*)

src/crypto/mod.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,7 @@ pub(crate) fn all_index_keys<E: Searchable + Encryptable>(sort_key: &str) -> Vec
5656
.collect()
5757
}
5858

59-
pub(crate) fn hmac<C>(
60-
value: &str,
61-
cipher: &Encryption<C>,
62-
) -> Result<String, EncryptionError>
59+
pub(crate) fn hmac<C>(value: &str, cipher: &Encryption<C>) -> Result<String, EncryptionError>
6360
where
6461
C: Credentials<Token = ViturToken>,
6562
{

src/crypto/sealer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ impl<T> Sealer<T> {
142142
.clone()
143143
.set_term(hex::encode(term))
144144
// TODO: HMAC the sort key, too (users#index_name#pk)
145-
.set_sk(hmac(&format!("{}#{}#{}", &sk, index_name, i), &cipher)?),
145+
.set_sk(hmac(&format!("{}#{}#{}", &sk, index_name, i), cipher)?),
146146
))
147147
})
148148
.chain(once(Ok(Sealed(table_entry.clone()))))

src/encrypted_table/table_entry.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ impl From<TableAttribute> for AttributeValue {
231231

232232
TableAttribute::Bytes(x) => AttributeValue::B(Blob::new(x)),
233233
TableAttribute::ByteVec(x) => {
234-
AttributeValue::Bs(x.into_iter().map(|x| Blob::new(x)).collect())
234+
AttributeValue::Bs(x.into_iter().map(Blob::new).collect())
235235
}
236236

237237
TableAttribute::Bool(x) => AttributeValue::Bool(x),

0 commit comments

Comments
 (0)