From 6212ccd51b4263d3541edaf0cd18fb36405f5a5c Mon Sep 17 00:00:00 2001 From: Pavel Mikhalkevich Date: Sat, 3 Aug 2024 17:35:00 +0400 Subject: [PATCH] Upd FaktoryCommand impl for ProgressUpdate --- src/proto/client/ent.rs | 2 +- src/proto/single/ent/cmd.rs | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/proto/client/ent.rs b/src/proto/client/ent.rs index 1414eafd..6f063a7e 100644 --- a/src/proto/client/ent.rs +++ b/src/proto/client/ent.rs @@ -11,7 +11,7 @@ impl Client { where P: AsRef + Sync, { - self.issue(&upd).await?.read_ok().await + self.issue(upd.as_ref()).await?.read_ok().await } /// Fetch information on a job's execution progress from Faktory. diff --git a/src/proto/single/ent/cmd.rs b/src/proto/single/ent/cmd.rs index 8edb5a88..8cfcfe3b 100644 --- a/src/proto/single/ent/cmd.rs +++ b/src/proto/single/ent/cmd.rs @@ -4,13 +4,10 @@ use crate::proto::{single::FaktoryCommand, JobId}; use tokio::io::{AsyncWrite, AsyncWriteExt}; #[async_trait::async_trait] -impl

FaktoryCommand for P -where - P: AsRef + Sync, -{ +impl FaktoryCommand for ProgressUpdate { async fn issue(&self, w: &mut W) -> Result<(), Error> { w.write_all(b"TRACK SET ").await?; - let r = serde_json::to_vec(self.as_ref()).map_err(Error::Serialization)?; + let r = serde_json::to_vec(self).map_err(Error::Serialization)?; w.write_all(&r).await?; Ok(w.write_all(b"\r\n").await?) }