Skip to content

Commit 17b3cb6

Browse files
authored
fix(store-encryption): Remove the displaydoc dependency
fix(store-encryption): Remove the `displaydoc` dependency
2 parents f8a6f90 + ad2e833 commit 17b3cb6

File tree

3 files changed

+25
-26
lines changed

3 files changed

+25
-26
lines changed

Cargo.lock

Lines changed: 0 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/matrix-sdk-store-encryption/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ js = ["dep:getrandom", "getrandom?/js"]
1717
base64 = { workspace = true }
1818
blake3 = "1.5.0"
1919
chacha20poly1305 = { version = "0.10.1", features = ["std"] }
20-
displaydoc = "0.2.4"
2120
getrandom = { version = "0.2.10", optional = true }
2221
hmac = "0.12.1"
2322
pbkdf2 = "0.12.2"

crates/matrix-sdk-store-encryption/src/lib.rs

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ use chacha20poly1305::{
2828
aead::{Aead, Error as EncryptionError},
2929
Key as ChachaKey, KeyInit, XChaCha20Poly1305, XNonce,
3030
};
31-
use displaydoc::Display;
3231
use hmac::Hmac;
3332
use pbkdf2::pbkdf2;
3433
use rand::{thread_rng, Error as RandomError, Fill};
@@ -46,26 +45,39 @@ const BASE64: GeneralPurpose = GeneralPurpose::new(&alphabet::STANDARD, general_
4645
type MacKeySeed = [u8; 32];
4746

4847
/// Error type for the `StoreCipher` operations.
49-
#[derive(Debug, Display, thiserror::Error)]
48+
#[derive(Debug, thiserror::Error)]
5049
pub enum Error {
51-
/// Failed to serialize a value {0}
50+
/// Failed to serialize a value.
51+
#[error("Failed to serialize a value: `{0}`")]
5252
Serialization(#[from] rmp_serde::encode::Error),
53-
/// Failed to deserialize a value {0}
53+
54+
/// Failed to deserialize a value.
55+
#[error("Failed to deserialize a value: `{0}`")]
5456
Deserialization(#[from] rmp_serde::decode::Error),
55-
/// Failed to deserialize or serialize a JSON value {0}
57+
58+
/// Failed to deserialize or serialize a JSON value.
59+
#[error("Failed to deserialize or serialize a JSON value: `{0}`")]
5660
Json(#[from] serde_json::Error),
57-
/// Error encrypting or decrypting a value {0}
61+
62+
/// Error encrypting or decrypting a value.
63+
#[error("Error encrypting or decrypting a value: `{0}`")]
5864
Encryption(#[from] EncryptionError),
59-
/// Couldn't generate enough randomness for a cryptographic operation: {0}
65+
66+
/// Could not generate enough randomness for a cryptographic operation: {0}
67+
#[error("Could not generate enough randomness for a cryptographic operation: `{0}`")]
6068
Random(#[from] RandomError),
61-
/// Unsupported ciphertext version, expected {0}, got {1}
69+
70+
/// Unsupported ciphertext version.
71+
#[error("Unsupported ciphertext version, expected `{0}`, got `{1}`")]
6272
Version(u8, u8),
63-
/// The ciphertext had an invalid length, expected {0}, got {1}
73+
74+
/// The ciphertext had an invalid length.
75+
#[error("The ciphertext had an invalid length, expected `{0}`, got `{1}`")]
6476
Length(usize, usize),
65-
/**
66-
* Failed to import a store cipher, the export used a passphrase while
67-
* we're trying to import it using a key or vice-versa.
68-
*/
77+
78+
/// Failed to import a store cipher, the export used a passphrase while
79+
/// we are trying to import it using a key or vice-versa.
80+
#[error("Failed to import a store cipher, the export used a passphrase while we are trying to import it using a key or vice-versa")]
6981
KdfMismatch,
7082
}
7183

0 commit comments

Comments
 (0)