Skip to content

Commit

Permalink
Upd FaktoryCommand impl for ProgressUpdate
Browse files Browse the repository at this point in the history
  • Loading branch information
rustworthy committed Aug 3, 2024
1 parent a1cfc1d commit 6212ccd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/proto/client/ent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ impl Client {
where
P: AsRef<ProgressUpdate> + Sync,
{
self.issue(&upd).await?.read_ok().await
self.issue(upd.as_ref()).await?.read_ok().await

Check warning on line 14 in src/proto/client/ent.rs

View check run for this annotation

Codecov / codecov/patch

src/proto/client/ent.rs#L10-L14

Added lines #L10 - L14 were not covered by tests
}

/// Fetch information on a job's execution progress from Faktory.
Expand Down
7 changes: 2 additions & 5 deletions src/proto/single/ent/cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@ use crate::proto::{single::FaktoryCommand, JobId};
use tokio::io::{AsyncWrite, AsyncWriteExt};

#[async_trait::async_trait]
impl<P> FaktoryCommand for P
where
P: AsRef<ProgressUpdate> + Sync,
{
impl FaktoryCommand for ProgressUpdate {
async fn issue<W: AsyncWrite + Unpin + Send>(&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?)
}

Check warning on line 13 in src/proto/single/ent/cmd.rs

View check run for this annotation

Codecov / codecov/patch

src/proto/single/ent/cmd.rs#L8-L13

Added lines #L8 - L13 were not covered by tests
Expand Down

0 comments on commit 6212ccd

Please sign in to comment.