Make sure all doctests and tests in wgpu-types run

This commit is contained in:
Connor Fitzgerald 2022-12-21 13:17:05 -05:00
parent eaa87ba42c
commit 9670e9e6b9
5 changed files with 7 additions and 6 deletions

View File

@ -336,7 +336,7 @@ jobs:
run: |
set -e
cargo test --doc
cargo test --doc -p wgpu -p wgpu-core -p wgpu-hal -p wgpu-types
fmt:
name: Format

View File

@ -13,7 +13,7 @@ members = [
"run-wasm"
]
exclude = []
default-members = ["wgpu", "wgpu-hal", "wgpu-info"]
default-members = ["wgpu", "wgpu-hal", "wgpu-info", "wgpu-types"]
[workspace.package]
edition = "2021"

View File

@ -81,7 +81,7 @@ This allows us to compose the operations to form the various kinds of tracker me
that need to happen in the codebase. For each resource in the given merger, the following
operation applies:
```
```text
UsageScope <- Resource = insert(scope, usage) OR merge(scope, usage)
UsageScope <- UsageScope = insert(scope, scope) OR merge(scope, scope)
CommandBuffer <- UsageScope = insert(buffer.start, buffer.end, scope)

View File

@ -25,4 +25,5 @@ bitflags = "1"
serde = { version = "1", features = ["serde_derive"], optional = true }
[dev-dependencies]
serde = { version = "1", features = ["serde_derive"] }
serde_json = "1.0.85"

View File

@ -9,7 +9,7 @@
)]
#![warn(missing_docs, unsafe_op_in_unsafe_fn)]
#[cfg(feature = "serde")]
#[cfg(any(feature = "serde", test))]
use serde::{Deserialize, Serialize};
use std::hash::{Hash, Hasher};
use std::{num::NonZeroU32, ops::Range};
@ -2103,7 +2103,7 @@ pub enum TextureFormat {
},
}
#[cfg(feature = "serde")]
#[cfg(any(feature = "serde", test))]
impl<'de> Deserialize<'de> for TextureFormat {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
@ -2239,7 +2239,7 @@ impl<'de> Deserialize<'de> for TextureFormat {
}
}
#[cfg(feature = "serde")]
#[cfg(any(feature = "serde", test))]
impl Serialize for TextureFormat {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where