Skip to content

Commit 14b0360

Browse files
chore(ffi): Remove all unnecessary derives (#135)
1 parent f421c61 commit 14b0360

File tree

21 files changed

+101
-116
lines changed

21 files changed

+101
-116
lines changed

crates/iota-sdk-ffi/src/error.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@
33

44
use std::fmt;
55

6-
use uniffi::Error;
7-
86
pub type Result<T, E = SdkFfiError> = std::result::Result<T, E>;
97

10-
#[derive(Debug, Error)]
8+
#[derive(Debug, uniffi::Error)]
119
#[uniffi(flat_error)]
1210
pub enum SdkFfiError {
1311
Generic(String),

crates/iota-sdk-ffi/src/faucet.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ impl FaucetClient {
8181
}
8282
}
8383

84-
#[derive(Clone, Debug, derive_more::From, uniffi::Object)]
84+
#[derive(derive_more::From, uniffi::Object)]
8585
pub struct FaucetReceipt(pub iota_graphql_client::faucet::FaucetReceipt);
8686

87-
#[derive(Clone, Debug, derive_more::From, uniffi::Object)]
87+
#[derive(derive_more::From, uniffi::Object)]
8888
pub struct BatchSendStatus(pub iota_graphql_client::faucet::BatchSendStatus);

crates/iota-sdk-ffi/src/types/address.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ use crate::error::Result;
5656
/// ```text
5757
/// address = 32OCTET
5858
/// ```
59-
#[derive(Copy, Clone, Debug, derive_more::From, derive_more::Deref, uniffi::Object)]
59+
#[derive(derive_more::From, derive_more::Deref, uniffi::Object)]
6060
pub struct Address(pub iota_types::Address);
6161

6262
#[uniffi::export]

crates/iota-sdk-ffi/src/types/checkpoint.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ pub type ProtocolVersion = u64;
5555
/// (option end-of-epoch-data) ; end_of_epoch_data
5656
/// bytes ; version_specific_data
5757
/// ```
58-
#[derive(Clone, Debug, uniffi::Record)]
58+
#[derive(uniffi::Record)]
5959
pub struct CheckpointSummary {
6060
/// Epoch that this checkpoint belongs to.
6161
pub epoch: u64,
@@ -144,7 +144,7 @@ impl From<CheckpointSummary> for iota_types::CheckpointSummary {
144144
/// checkpoint-commitment = ecmh-live-object-set
145145
/// ecmh-live-object-set = %x00 digest
146146
/// ```
147-
#[derive(Clone, Debug, derive_more::From, uniffi::Object)]
147+
#[derive(derive_more::From, uniffi::Object)]
148148
pub struct CheckpointCommitment(pub iota_types::CheckpointCommitment);
149149

150150
#[uniffi::export]
@@ -158,7 +158,7 @@ impl CheckpointCommitment {
158158
}
159159
}
160160

161-
#[derive(Clone, Debug, uniffi::Record)]
161+
#[derive(uniffi::Record)]
162162
pub struct EndOfEpochData {
163163
pub next_epoch_committee: Vec<ValidatorCommitteeMember>,
164164
pub next_epoch_protocol_version: u64,

crates/iota-sdk-ffi/src/types/coin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use crate::{
99
},
1010
};
1111

12-
#[derive(Clone, Debug, derive_more::From, uniffi::Object)]
12+
#[derive(derive_more::From, uniffi::Object)]
1313
pub struct Coin(pub iota_types::framework::Coin);
1414

1515
#[uniffi::export]

crates/iota-sdk-ffi/src/types/crypto/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use crate::{error::Result, types::signature::SimpleSignature};
1313
macro_rules! impl_crypto_object {
1414
($(#[$meta:meta])* $t:ident) => {
1515
$(#[$meta])*
16-
#[derive(Copy, Clone, Debug, derive_more::From, derive_more::Deref, uniffi::Object)]
16+
#[derive(derive_more::From, derive_more::Deref, uniffi::Object)]
1717
pub struct $t(pub iota_types::$t);
1818

1919
#[uniffi::export]

crates/iota-sdk-ffi/src/types/crypto/multisig.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use crate::types::crypto::{
2828
/// secp256r1-multisig-member-signature = %x02 secp256r1-signature
2929
/// zklogin-multisig-member-signature = %x03 zklogin-authenticator
3030
/// ```
31-
#[derive(Clone, Debug, derive_more::From, uniffi::Object)]
31+
#[derive(derive_more::From, uniffi::Object)]
3232
pub struct MultisigMemberSignature(pub iota_types::MultisigMemberSignature);
3333

3434
#[uniffi::export]
@@ -126,7 +126,7 @@ impl MultisigMemberSignature {
126126
/// (secp256k1-flag secp256k1-public-key) /
127127
/// (secp256r1-flag secp256r1-public-key)
128128
/// ```
129-
#[derive(Clone, Debug, derive_more::From, uniffi::Object)]
129+
#[derive(derive_more::From, uniffi::Object)]
130130
pub struct MultisigMemberPublicKey(pub iota_types::MultisigMemberPublicKey);
131131

132132
#[uniffi::export]
@@ -221,7 +221,7 @@ impl MultisigMemberPublicKey {
221221
///
222222
/// See [here](https://github.com/RoaringBitmap/RoaringFormatSpec) for the specification for the
223223
/// serialized format of RoaringBitmaps.
224-
#[derive(Clone, Debug, derive_more::From, uniffi::Object)]
224+
#[derive(derive_more::From, uniffi::Object)]
225225
pub struct MultisigAggregatedSignature(pub iota_types::MultisigAggregatedSignature);
226226

227227
#[uniffi::export]
@@ -290,7 +290,7 @@ impl MultisigAggregatedSignature {
290290
/// legacy-multisig-committee = (vector legacy-multisig-member)
291291
/// u16 ; threshold
292292
/// ```
293-
#[derive(Clone, Debug, derive_more::From, uniffi::Object)]
293+
#[derive(derive_more::From, uniffi::Object)]
294294
pub struct MultisigCommittee(pub iota_types::MultisigCommittee);
295295

296296
#[uniffi::export]
@@ -362,7 +362,7 @@ impl MultisigCommittee {
362362
/// legacy-multisig-member = legacy-multisig-member-public-key
363363
/// u8 ; weight
364364
/// ```
365-
#[derive(Clone, Debug, derive_more::From, uniffi::Object)]
365+
#[derive(derive_more::From, uniffi::Object)]
366366
pub struct MultisigMember(pub iota_types::MultisigMember);
367367

368368
#[uniffi::export]

crates/iota-sdk-ffi/src/types/crypto/passkey.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ use crate::{error::Result, types::signature::SimpleSignature};
3232
/// signature is ever embedded in another structure it generally is serialized
3333
/// as `bytes` meaning it has a length prefix that defines the length of
3434
/// the completely serialized signature.
35-
#[derive(Clone, Debug, derive_more::From, uniffi::Object)]
35+
#[derive(derive_more::From, uniffi::Object)]
3636
pub struct PasskeyAuthenticator(pub iota_types::PasskeyAuthenticator);
3737

3838
#[uniffi::export]

crates/iota-sdk-ffi/src/types/crypto/validator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use crate::types::crypto::Bls12381PublicKey;
1515
/// validator-committee-member = bls-public-key
1616
/// u64 ; stake
1717
/// ```
18-
#[derive(Clone, Debug, uniffi::Record)]
18+
#[derive(uniffi::Record)]
1919
pub struct ValidatorCommitteeMember {
2020
pub public_key: Arc<Bls12381PublicKey>,
2121
pub stake: u64,

crates/iota-sdk-ffi/src/types/crypto/zklogin.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use crate::{
2929
/// signature is ever embedded in another structure it generally is serialized
3030
/// as `bytes` meaning it has a length prefix that defines the length of
3131
/// the completely serialized signature.
32-
#[derive(Clone, Debug, derive_more::From, uniffi::Object)]
32+
#[derive(derive_more::From, uniffi::Object)]
3333
pub struct ZkLoginAuthenticator(pub iota_types::ZkLoginAuthenticator);
3434

3535
#[uniffi::export]
@@ -108,7 +108,7 @@ impl ZkLoginAuthenticator {
108108
/// ```
109109
///
110110
/// [`Address`]: crate::Address
111-
#[derive(Clone, Debug, derive_more::From, uniffi::Object)]
111+
#[derive(derive_more::From, uniffi::Object)]
112112
pub struct ZkLoginPublicIdentifier(pub iota_types::ZkLoginPublicIdentifier);
113113

114114
#[uniffi::export]
@@ -142,7 +142,7 @@ impl ZkLoginPublicIdentifier {
142142
/// string ; base64url-unpadded encoded JwtHeader
143143
/// bn254-field-element ; address_seed
144144
/// ```
145-
#[derive(Clone, Debug, derive_more::From, uniffi::Object)]
145+
#[derive(derive_more::From, uniffi::Object)]
146146
pub struct ZkLoginInputs(pub iota_types::ZkLoginInputs);
147147

148148
#[uniffi::export]
@@ -188,7 +188,7 @@ impl ZkLoginInputs {
188188
/// ```text
189189
/// zklogin-proof = circom-g1 circom-g2 circom-g1
190190
/// ```
191-
#[derive(Clone, Debug, derive_more::From, uniffi::Object)]
191+
#[derive(derive_more::From, uniffi::Object)]
192192
pub struct ZkLoginProof(pub iota_types::ZkLoginProof);
193193

194194
#[uniffi::export]
@@ -242,7 +242,7 @@ pub struct ZkLoginClaim {
242242
/// ```text
243243
/// circom-g1 = %x03 3(bn254-field-element)
244244
/// ```
245-
#[derive(Clone, Debug, derive_more::From, uniffi::Object)]
245+
#[derive(derive_more::From, uniffi::Object)]
246246
pub struct CircomG1(pub iota_types::CircomG1);
247247

248248
#[uniffi::export]
@@ -273,7 +273,7 @@ impl CircomG1 {
273273
/// ```text
274274
/// circom-g2 = %x03 3(%x02 2(bn254-field-element))
275275
/// ```
276-
#[derive(Clone, Debug, derive_more::From, uniffi::Object)]
276+
#[derive(derive_more::From, uniffi::Object)]
277277
pub struct CircomG2(pub iota_types::CircomG2);
278278

279279
#[uniffi::export]
@@ -308,7 +308,7 @@ impl CircomG2 {
308308
/// ```text
309309
/// bn254-field-element = *DIGIT ; which is then interpreted as a radix10 encoded 32-byte value
310310
/// ```
311-
#[derive(Clone, Debug, derive_more::From, uniffi::Object)]
311+
#[derive(derive_more::From, uniffi::Object)]
312312
pub struct Bn254FieldElement(pub iota_types::Bn254FieldElement);
313313

314314
#[uniffi::export]

0 commit comments

Comments
 (0)