Skip to content

Commit b4b40f5

Browse files
authored
fix(types): fix serde feature gates (#1121)
1 parent 344cdcb commit b4b40f5

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

crates/iota-sdk-types/src/move_package.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ pub struct TypeOrigin {
120120
/// The name of the data type. Either refers to an enum or a struct
121121
/// identifier.
122122
// `struct_name` alias to support backwards compatibility with the old name
123-
#[serde(alias = "struct_name")]
123+
#[cfg_attr(feature = "serde", serde(alias = "struct_name"))]
124124
pub datatype_name: Identifier,
125125
/// ID of the package, where the given type first appeared.
126126
pub package: ObjectId,

crates/iota-sdk-types/src/object.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
// Modifications Copyright (c) 2025 IOTA Stiftung
33
// SPDX-License-Identifier: Apache-2.0
44

5+
#[cfg(feature = "serde")]
56
use std::collections::BTreeMap;
67

7-
use super::{
8-
Address, Digest, Identifier, MovePackage, ObjectId, StructTag, TypeOrigin, UpgradeInfo, Version,
9-
};
8+
use super::{Address, Digest, MovePackage, ObjectId, StructTag, Version};
9+
#[cfg(feature = "serde")]
10+
use super::{Identifier, TypeOrigin, UpgradeInfo};
1011

1112
/// Reference to an object
1213
///

0 commit comments

Comments
 (0)