@@ -46,8 +46,8 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
46
46
// 4. Serialize the tuple to its consensus-cricital hex string.
47
47
let hex_string = my_tuple . serialize_to_hex ()? ;
48
48
49
- println! (" Clarity Tuple: {} " , my_tuple );
50
- println! (" Serialized Hex: {} " , hex_string );
49
+ println! (" Clarity Tuple: {my_tuple} " );
50
+ println! (" Serialized Hex: {hex_string} " );
51
51
52
52
// The output `hex_string` can now be used in a contract-call transaction.
53
53
assert_eq! (
@@ -72,12 +72,12 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
72
72
// 1. First, let's deserialize without a type for inspection.
73
73
// NOTE: This is not recommended for production use with data from untrusted sources.
74
74
let untyped_value = Value :: try_deserialize_hex_untyped (hex_string )? ;
75
- println! (" Deserialized (untyped): {:?} " , untyped_value );
75
+ println! (" Deserialized (untyped): {untyped_value} " );
76
76
77
77
// 2. For robust deserialization, we should define the expected type.
78
78
// This can be derived from the untyped value or known from a contract's interface.
79
79
let expected_type = TypeSignature :: type_of (& untyped_value )? ;
80
- println! (" Inferred Type Signature: {} " , expected_type );
80
+ println! (" Inferred Type Signature: {expected_type} " );
81
81
82
82
// 3. Deserialize again, this time enforcing the type signature.
83
83
// The `sanitize` flag should be `true` when reading values from the DB
@@ -90,8 +90,8 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
90
90
let owner = tuple_data . get (" owner" )? . clone (). expect_principal ()? ;
91
91
92
92
println! (" Successfully deserialized and validated!" );
93
- println! (" ID: {} " , id );
94
- println! (" Owner: {} " , owner );
93
+ println! (" ID: {id} " );
94
+ println! (" Owner: {owner} " );
95
95
96
96
Ok (())
97
97
}
0 commit comments