Address clippy lints

This commit is contained in:
Tim Kuehn
2020-07-27 00:04:35 -07:00
parent 42a2e03aab
commit 2bae148529
3 changed files with 5 additions and 3 deletions

View File

@@ -156,7 +156,7 @@ impl Parse for DeriveSerde {
result,
syn::Error::new(
meta.span(),
format!("tarpc::service does not support this meta item")
"tarpc::service does not support this meta item"
)
);
continue;
@@ -167,7 +167,7 @@ impl Parse for DeriveSerde {
result,
syn::Error::new(
meta.span(),
format!("tarpc::service does not support this meta item")
"tarpc::service does not support this meta item"
)
);
continue;

View File

@@ -48,6 +48,7 @@ log = "0.4"
pin-utils = "0.1.0-alpha"
tokio = { version = "0.2", features = ["full"] }
tokio-serde = { version = "0.6", features = ["json"] }
trybuild = "1.0"
[[example]]
name = "server_calling_server"

View File

@@ -15,9 +15,10 @@ pub fn serialize_epoch_secs<S>(system_time: &SystemTime, serializer: S) -> Resul
where
S: Serializer,
{
const ZERO_SECS: Duration = Duration::from_secs(0);
system_time
.duration_since(SystemTime::UNIX_EPOCH)
.unwrap_or(Duration::from_secs(0))
.unwrap_or(ZERO_SECS)
.as_secs() // Only care about second precision
.serialize(serializer)
}