From f512b4a5c24d8a5adf71b88c5d17a3b2e24cd66b Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Tue, 16 Jan 2024 20:51:44 +0800 Subject: [PATCH] Refactor NBT data cloning --- crates/nbt-test/src/main.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/nbt-test/src/main.rs b/crates/nbt-test/src/main.rs index d02a2cf..3fefe5a 100644 --- a/crates/nbt-test/src/main.rs +++ b/crates/nbt-test/src/main.rs @@ -168,9 +168,9 @@ fn read_test(in_data: Vec) { println!("data: {:?}", data); let data = in_data.clone(); - let data2 = in_data.clone(); - let data3 = in_data.clone(); - let data4 = in_data.clone(); + // let data2 = in_data.clone(); + // let data3 = in_data.clone(); + // let data4 = in_data.clone(); std::thread::sleep(std::time::Duration::from_secs(1)); test_lib!( { @@ -181,19 +181,19 @@ fn read_test(in_data: Vec) { test_lib!( { - let _nbt_data = shen_nbt2::Value::from_vec(data2); + let _nbt_data = shen_nbt2::Value::from_vec(data.as_slice().to_vec()); }, "nbt v2", len ); test_lib!( { - let _nbt_data = shen_nbt3::Value::from_vec(data3); + let _nbt_data = shen_nbt3::Value::from_vec(data.as_slice().to_vec()); }, "nbt v3", len ); test_lib!( { - let _nbt_data = shen_nbt4::Value::from_vec(data4); + let _nbt_data = shen_nbt4::Value::from_vec(data.as_slice().to_vec()); }, "nbt v4", len );