mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-25 16:24:24 +00:00
Fix deserialization of arenas
This commit is contained in:
parent
0feea58a34
commit
1907a92928
@ -125,16 +125,13 @@ impl<T> Iterator for Range<T> {
|
|||||||
/// The arena can be indexed using the given handle to obtain
|
/// The arena can be indexed using the given handle to obtain
|
||||||
/// a reference to the stored item.
|
/// a reference to the stored item.
|
||||||
#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
|
#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
|
||||||
#[cfg_attr(
|
#[cfg_attr(feature = "serialize", serde(transparent))]
|
||||||
any(feature = "serialize", feature = "deserialize"),
|
|
||||||
serde(transparent)
|
|
||||||
)]
|
|
||||||
#[cfg_attr(test, derive(PartialEq))]
|
#[cfg_attr(test, derive(PartialEq))]
|
||||||
pub struct Arena<T> {
|
pub struct Arena<T> {
|
||||||
/// Values of this arena.
|
/// Values of this arena.
|
||||||
data: Vec<T>,
|
data: Vec<T>,
|
||||||
#[cfg(feature = "span")]
|
#[cfg(feature = "span")]
|
||||||
#[cfg_attr(any(feature = "serialize", feature = "deserialize"), serde(skip))]
|
#[cfg_attr(feature = "serialize", serde(skip))]
|
||||||
span_info: Vec<Span>,
|
span_info: Vec<Span>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,14 +4,11 @@ use std::ops::{Deref, DerefMut, RangeBounds};
|
|||||||
/// A code block is a vector of statements, with maybe a vector of spans.
|
/// A code block is a vector of statements, with maybe a vector of spans.
|
||||||
#[derive(Debug, Clone, Default)]
|
#[derive(Debug, Clone, Default)]
|
||||||
#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
|
#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
|
||||||
#[cfg_attr(
|
#[cfg_attr(feature = "serialize", serde(transparent))]
|
||||||
any(feature = "serialize", feature = "deserialize"),
|
|
||||||
serde(transparent)
|
|
||||||
)]
|
|
||||||
pub struct Block {
|
pub struct Block {
|
||||||
body: Vec<Statement>,
|
body: Vec<Statement>,
|
||||||
#[cfg(feature = "span")]
|
#[cfg(feature = "span")]
|
||||||
#[cfg_attr(any(feature = "serialize", feature = "deserialize"), serde(skip))]
|
#[cfg_attr(feature = "serialize", serde(skip))]
|
||||||
span_info: Vec<Span>,
|
span_info: Vec<Span>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user