diff options
author | syn <isaqtm@gmail.com> | 2020-02-14 14:21:17 +0300 |
---|---|---|
committer | syn <isaqtm@gmail.com> | 2020-02-14 14:21:17 +0300 |
commit | 73e7e264cc996c42510d9c8e774dd46cfc160a74 (patch) | |
tree | 9416ff130da63809d0205b599a3e3ba3cf40e569 /src/backends/clang.rs | |
parent | 3da19e8603c00c02ec7e24ea8910a7c386b09018 (diff) | |
download | evr-73e7e264cc996c42510d9c8e774dd46cfc160a74.tar.gz |
deserialize duration from floats
Diffstat (limited to 'src/backends/clang.rs')
-rw-r--r-- | src/backends/clang.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/backends/clang.rs b/src/backends/clang.rs index 11c316a..361c759 100644 --- a/src/backends/clang.rs +++ b/src/backends/clang.rs @@ -1,4 +1,4 @@ -use serde_derive::{ Serialize, Deserialize }; +use serde_derive::Deserialize; use crate::backends::{ Backend, mk_tmp_dir, RunError }; use std::path::{ Path, PathBuf }; use std::io::{ Result as IoResult, Error, ErrorKind }; @@ -7,9 +7,10 @@ use std::collections::hash_map::DefaultHasher; use std::hash::{ Hash, Hasher }; use crate::wait::{ ChildExitStatus, wait_child }; use std::time::Duration; +use crate::serde_duration::deserialize_duration; -#[derive(Debug, Serialize, Deserialize, Default)] +#[derive(Debug, Deserialize, Default)] pub struct ClangBackend { template: Option<String>, @@ -19,7 +20,7 @@ pub struct ClangBackend { #[serde(default = "default_cc")] cc: String, - #[serde(default = "default_timeout")] + #[serde(default = "default_timeout", deserialize_with = "deserialize_duration")] timeout: Duration } |