mirror of
https://github.com/OMGeeky/tarpc.git
synced 2025-12-28 23:27:25 +01:00
Address clippy lints
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user