forked from rust-windowing/winit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add optional Serde implementations and missing derivable traits (rust…
…-windowing#652) * Add optional serde feature * Document features in README * Add changelog entry * Implement some missing derivable traits * Add changelog entry for std derives * Remove extraneous space on serde doc comments * Add period to end of serde line in readme * Remove serde impls from WindowAttributes * Add serde impls for TouchPhase * Add serde test file * Add feature lines to testing CIs * Remove WindowAttributes from changelog
- Loading branch information
1 parent
214e157
commit 6bec912
Showing
9 changed files
with
79 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#![cfg(feature = "serde")] | ||
|
||
extern crate serde; | ||
extern crate winit; | ||
|
||
use winit::{ControlFlow, MouseCursor}; | ||
use winit::{ | ||
KeyboardInput, TouchPhase, ElementState, MouseButton, MouseScrollDelta, VirtualKeyCode, | ||
ModifiersState | ||
}; | ||
use winit::dpi::{LogicalPosition, PhysicalPosition, LogicalSize, PhysicalSize}; | ||
use serde::{Serialize, Deserialize}; | ||
|
||
fn needs_serde<S: Serialize + Deserialize<'static>>() {} | ||
|
||
#[test] | ||
fn root_serde() { | ||
needs_serde::<ControlFlow>(); | ||
needs_serde::<MouseCursor>(); | ||
} | ||
|
||
#[test] | ||
fn events_serde() { | ||
needs_serde::<KeyboardInput>(); | ||
needs_serde::<TouchPhase>(); | ||
needs_serde::<ElementState>(); | ||
needs_serde::<MouseButton>(); | ||
needs_serde::<MouseScrollDelta>(); | ||
needs_serde::<VirtualKeyCode>(); | ||
needs_serde::<ModifiersState>(); | ||
} | ||
|
||
#[test] | ||
fn dpi_serde() { | ||
needs_serde::<LogicalPosition>(); | ||
needs_serde::<PhysicalPosition>(); | ||
needs_serde::<LogicalSize>(); | ||
needs_serde::<PhysicalSize>(); | ||
} |