From 1907a92928933f312da10daad85bdc6de7d5f9a9 Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Thu, 12 Aug 2021 22:48:27 -0400 Subject: [PATCH] Fix deserialization of arenas --- src/arena.rs | 7 ++----- src/block.rs | 7 ++----- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/arena.rs b/src/arena.rs index 4827433da..c7b9e8664 100644 --- a/src/arena.rs +++ b/src/arena.rs @@ -125,16 +125,13 @@ impl Iterator for Range { /// The arena can be indexed using the given handle to obtain /// a reference to the stored item. #[cfg_attr(feature = "serialize", derive(serde::Serialize))] -#[cfg_attr( - any(feature = "serialize", feature = "deserialize"), - serde(transparent) -)] +#[cfg_attr(feature = "serialize", serde(transparent))] #[cfg_attr(test, derive(PartialEq))] pub struct Arena { /// Values of this arena. data: Vec, #[cfg(feature = "span")] - #[cfg_attr(any(feature = "serialize", feature = "deserialize"), serde(skip))] + #[cfg_attr(feature = "serialize", serde(skip))] span_info: Vec, } diff --git a/src/block.rs b/src/block.rs index d7bcaed63..b46293eab 100644 --- a/src/block.rs +++ b/src/block.rs @@ -4,14 +4,11 @@ use std::ops::{Deref, DerefMut, RangeBounds}; /// A code block is a vector of statements, with maybe a vector of spans. #[derive(Debug, Clone, Default)] #[cfg_attr(feature = "serialize", derive(serde::Serialize))] -#[cfg_attr( - any(feature = "serialize", feature = "deserialize"), - serde(transparent) -)] +#[cfg_attr(feature = "serialize", serde(transparent))] pub struct Block { body: Vec, #[cfg(feature = "span")] - #[cfg_attr(any(feature = "serialize", feature = "deserialize"), serde(skip))] + #[cfg_attr(feature = "serialize", serde(skip))] span_info: Vec, }