Skip to content

Commit a2afdf3

Browse files
committed
Fmt
1 parent cc1c27e commit a2afdf3

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

crates/bitwarden-crypto/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ pub use wordlist::EFF_LONG_WORD_LIST;
8383
mod store;
8484
pub use store::{KeyStore, KeyStoreContext};
8585
mod traits;
86-
pub use traits::{Decryptable, Encryptable, KeyId, KeyIds, IdentifyKey};
86+
pub use traits::{Decryptable, Encryptable, IdentifyKey, KeyId, KeyIds};
8787
pub use zeroizing_alloc::ZeroAlloc as ZeroizingAllocator;
8888

8989
#[cfg(feature = "uniffi")]

crates/bitwarden-crypto/src/store/mod.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,10 @@ impl<Ids: KeyIds> KeyStore<Ids> {
163163
data.encrypt(&mut self.context(), key)
164164
}
165165

166-
/// Decrypt a list of items using this key store. The keys returned by `data[i].key_identifier()` must
167-
/// already be present in the store, otherwise this will return an error.
168-
/// This method will try to parallelize the decryption of the items, for better performance on
169-
/// large lists.
166+
/// Decrypt a list of items using this key store. The keys returned by
167+
/// `data[i].key_identifier()` must already be present in the store, otherwise this will
168+
/// return an error. This method will try to parallelize the decryption of the items, for
169+
/// better performance on large lists.
170170
pub fn decrypt_list<
171171
Key: KeyId,
172172
Data: Decryptable<Ids, Key, Output> + IdentifyKey<Key> + Send + Sync,
@@ -196,10 +196,11 @@ impl<Ids: KeyIds> KeyStore<Ids> {
196196
res
197197
}
198198

199-
/// Encrypt a list of items using this key store. The keys returned by `data[i].key_identifier()` must
200-
/// already be present in the store, otherwise this will return an error.
201-
/// This method will try to parallelize the encryption of the items, for better performance on
202-
/// large lists. This method is not parallelized, and is meant for single item encryption.
199+
/// Encrypt a list of items using this key store. The keys returned by
200+
/// `data[i].key_identifier()` must already be present in the store, otherwise this will
201+
/// return an error. This method will try to parallelize the encryption of the items, for
202+
/// better performance on large lists. This method is not parallelized, and is meant for
203+
/// single item encryption.
203204
pub fn encrypt_list<
204205
Key: KeyId,
205206
Data: Encryptable<Ids, Key, Output> + IdentifyKey<Key> + Send + Sync,

crates/bitwarden-crypto/src/traits/decryptable.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ mod tests {
140140
let string_decrypted: Option<String> = none_data.decrypt(&mut ctx, key).unwrap();
141141
assert_eq!(string_decrypted, None);
142142

143-
// The None implementation will not do any decrypt operations, so it won't fail even if the key doesn't exist
143+
// The None implementation will not do any decrypt operations, so it won't fail even if the
144+
// key doesn't exist
144145
let bad_key = TestSymmKey::B((0, 1));
145146
let string_decrypted_bad: Option<String> = none_data.decrypt(&mut ctx, bad_key).unwrap();
146147
assert_eq!(string_decrypted_bad, None);

crates/bitwarden-crypto/src/traits/encryptable.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,8 @@ mod tests {
241241
let string_encrypted = none_data.encrypt(&mut ctx, key).unwrap();
242242
assert_eq!(string_encrypted, None);
243243

244-
// The None implementation will not do any decrypt operations, so it won't fail even if the key doesn't exist
244+
// The None implementation will not do any decrypt operations, so it won't fail even if the
245+
// key doesn't exist
245246
let bad_key = TestSymmKey::B((0, 1));
246247
let string_encrypted_bad = none_data.encrypt(&mut ctx, bad_key).unwrap();
247248
assert_eq!(string_encrypted_bad, None);

0 commit comments

Comments
 (0)