From 9d46bd889f293b5f1eae79214c2809867c6c8fa8 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Tue, 23 Jul 2019 13:31:01 -0700 Subject: [PATCH] pty: fixup build when serde_support is not enabled --- pty/src/cmdbuilder.rs | 4 +++- pty/src/lib.rs | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pty/src/cmdbuilder.rs b/pty/src/cmdbuilder.rs index 60f6f239c..ba3977176 100644 --- a/pty/src/cmdbuilder.rs +++ b/pty/src/cmdbuilder.rs @@ -2,6 +2,7 @@ use failure::{ensure, Error}; #[cfg(windows)] use log::error; +#[cfg(feature = "serde_support")] use serde_derive::*; use std::ffi::{OsStr, OsString}; #[cfg(windows)] @@ -9,7 +10,8 @@ use std::os::windows::ffi::OsStrExt; /// `CommandBuilder` is used to prepare a command to be spawned into a pty. /// The interface is intentionally similar to that of `std::process::Command`. -#[derive(Debug, Serialize, Deserialize, PartialEq)] +#[derive(Debug, PartialEq)] +#[cfg_attr(feature = "serde_support", derive(Serialize, Deserialize))] pub struct CommandBuilder { args: Vec, envs: Vec<(OsString, OsString)>, diff --git a/pty/src/lib.rs b/pty/src/lib.rs index 47a304990..b93c12f1b 100644 --- a/pty/src/lib.rs +++ b/pty/src/lib.rs @@ -50,7 +50,8 @@ pub mod unix; pub mod win; /// Represents the size of the visible display area in the pty -#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Clone, Copy, PartialEq)] +#[cfg_attr(feature = "serde_support", derive(Serialize, Deserialize))] pub struct PtySize { /// The number of lines of text pub rows: u16,