Skip to content

Commit b5a4828

Browse files
committed
format strings inline in examples
1 parent 678f122 commit b5a4828

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

clarity-serialization/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
4646
// 4. Serialize the tuple to its consensus-cricital hex string.
4747
let hex_string = my_tuple.serialize_to_hex()?;
4848

49-
println!("Clarity Tuple: {}", my_tuple);
50-
println!("Serialized Hex: {}", hex_string);
49+
println!("Clarity Tuple: {my_tuple}");
50+
println!("Serialized Hex: {hex_string}");
5151

5252
// The output `hex_string` can now be used in a contract-call transaction.
5353
assert_eq!(
@@ -72,12 +72,12 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
7272
// 1. First, let's deserialize without a type for inspection.
7373
// NOTE: This is not recommended for production use with data from untrusted sources.
7474
let untyped_value = Value::try_deserialize_hex_untyped(hex_string)?;
75-
println!("Deserialized (untyped): {:?}", untyped_value);
75+
println!("Deserialized (untyped): {untyped_value}");
7676

7777
// 2. For robust deserialization, we should define the expected type.
7878
// This can be derived from the untyped value or known from a contract's interface.
7979
let expected_type = TypeSignature::type_of(&untyped_value)?;
80-
println!("Inferred Type Signature: {}", expected_type);
80+
println!("Inferred Type Signature: {expected_type}");
8181

8282
// 3. Deserialize again, this time enforcing the type signature.
8383
// The `sanitize` flag should be `true` when reading values from the DB
@@ -90,8 +90,8 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
9090
let owner = tuple_data.get("owner")?.clone().expect_principal()?;
9191

9292
println!("Successfully deserialized and validated!");
93-
println!("ID: {}", id);
94-
println!("Owner: {}", owner);
93+
println!("ID: {id}");
94+
println!("Owner: {owner}");
9595

9696
Ok(())
9797
}

0 commit comments

Comments
 (0)