()
| 2585 | |
| 2586 | #[test] |
| 2587 | fn externref_data_mut_some() -> Result<()> { |
| 2588 | let mut store = gc_store()?; |
| 2589 | let rooted = ExternRef::new(&mut store, 1u32)?; |
| 2590 | { |
| 2591 | let data = rooted.data_mut(&mut store)?; |
| 2592 | *data.unwrap().downcast_mut::<u32>().unwrap() = 999; |
| 2593 | } |
| 2594 | let val = rooted.data(&store)?.unwrap().downcast_ref::<u32>().unwrap(); |
| 2595 | assert_eq!(*val, 999u32); |
| 2596 | Ok(()) |
| 2597 | } |
| 2598 | |
| 2599 | #[test] |
| 2600 | fn externref_data_none_when_converted_from_anyref() -> Result<()> { |