Skip to content

Commit 9a52b8f

Browse files
committed
fix zero copy derive test
1 parent 96a23e5 commit 9a52b8f

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

program-libs/zero-copy-derive/tests/ui/pass/02_single_u8_field.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,20 @@ fn main() {
1515
let ref_struct = SingleU8 { value: 42 };
1616
let bytes = ref_struct.try_to_vec().unwrap();
1717

18-
let (struct_copy, _remaining) = SingleU8::zero_copy_at(&bytes).unwrap();
18+
let (struct_copy, remaining) = SingleU8::zero_copy_at(&bytes).unwrap();
1919
assert_eq!(struct_copy, ref_struct);
20-
assert!(_remaining.is_empty());
20+
assert!(remaining.is_empty());
2121

2222
let mut bytes_mut = bytes.clone();
23-
let (_struct_copy_mut, _remaining) = SingleU8::zero_copy_at_mut(&mut bytes_mut).unwrap();
24-
assert!(_remaining.is_empty());
23+
let (_struct_copy_mut, remaining) = SingleU8::zero_copy_at_mut(&mut bytes_mut).unwrap();
24+
assert!(remaining.is_empty());
2525
// assert byte len
2626
let config = ();
2727
let byte_len = SingleU8::byte_len(&config).unwrap();
2828
assert_eq!(bytes.len(), byte_len);
2929
let mut new_bytes = vec![0u8; byte_len];
30-
<<<<<<< HEAD
31-
let (mut struct_copy_mut, remaining) = SingleU8::new_zero_copy(&mut new_bytes, config).unwrap();
32-
=======
33-
let (mut struct_copy_mut, _remaining) = SingleU8::new_zero_copy(&mut new_bytes, config).unwrap();
34-
>>>>>>> fc4574cfa (feat: ctoken pinocchio)
30+
let (mut struct_copy_mut, _remaining) =
31+
SingleU8::new_zero_copy(&mut new_bytes, config).unwrap();
3532
// convert primitive to zero copy type
3633
struct_copy_mut.value = 42.into();
3734
assert_eq!(new_bytes, bytes);

0 commit comments

Comments
 (0)