Skip to content

Commit

Permalink
Remove rpm_serde from dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
spirali authored and Kobzol committed May 23, 2024
1 parent aaa20bd commit 9ff6b91
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 43 deletions.
13 changes: 0 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ bincode = "1"
futures = "0.3"
tokio-util = "0.7"
byteorder = "1"
rmp-serde = "1"
hex = "0.4"
rand = "0.8"
gethostname = "0.4"
Expand Down
7 changes: 3 additions & 4 deletions crates/hyperqueue/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@ tokio = { workspace = true, features = ["full"] }
tokio-util = { workspace = true, features = ["codec"] }
clap = { workspace = true, features = ["derive", "env"] }
clap_complete = { workspace = true }
rmp-serde = { workspace = true}
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
serde_bytes = { workspace = true }
bytes = {workspace = true }
bytes = { workspace = true }
thiserror = { workspace = true }
gethostname = { workspace = true }
chrono = { workspace = true, features = ["serde"] }
Expand All @@ -29,7 +28,7 @@ hex = { workspace = true }
bincode = { workspace = true }
smallvec = { workspace = true }
rand = { workspace = true }
anyhow = { workspace = true }
anyhow = { workspace = true }
tempdir = { workspace = true }
nix = { workspace = true }
bstr = { workspace = true }
Expand All @@ -44,7 +43,7 @@ serde-tuple-vec-map = "1"
dirs = "5.0"
rmpv = { version = "1.0", features = ["with-serde"] }
nom = "7.1"
nom-supreme = { version = "0.8"}
nom-supreme = { version = "0.8" }
colored = "2"
const_format = "0.2"
textwrap = "0.16"
Expand Down
11 changes: 0 additions & 11 deletions crates/hyperqueue/src/common/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,6 @@ impl From<bincode::Error> for HqError {
}
}

impl From<rmp_serde::encode::Error> for HqError {
fn from(e: rmp_serde::encode::Error) -> Self {
Self::SerializationError(e.to_string())
}
}
impl From<rmp_serde::decode::Error> for HqError {
fn from(e: rmp_serde::decode::Error) -> Self {
Self::SerializationError(e.to_string())
}
}

impl From<anyhow::Error> for HqError {
fn from(error: anyhow::Error) -> Self {
Self::GenericError(error.to_string())
Expand Down
2 changes: 1 addition & 1 deletion crates/hyperqueue/src/server/event/log/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ mod tests {
let path = tmpdir.path().join("foo");
{
let mut file = File::create(&path).unwrap();
rmp_serde::encode::write(&mut file, "hqjl0000").unwrap();
file.write_all("hqjlxxxx".as_bytes()).unwrap();
file.flush().unwrap();
}
assert!(EventLogReader::open(&path).is_err());
Expand Down
1 change: 0 additions & 1 deletion crates/tako/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ tokio-util = { workspace = true, features = ["codec"] }
bytes = { workspace = true }
byteorder = { workspace = true }
smallvec = { workspace = true, features = ["serde"] }
rmp-serde = { workspace = true }
serde = { workspace = true, features = ["derive"] }
serde_bytes = { workspace = true }
serde_json = { workspace = true }
Expand Down
10 changes: 0 additions & 10 deletions crates/tako/src/internal/common/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,6 @@ impl From<serde_json::error::Error> for DsError {
Self::SerializationError(e.to_string())
}
}
impl From<rmp_serde::encode::Error> for DsError {
fn from(e: rmp_serde::encode::Error) -> Self {
Self::SerializationError(e.to_string())
}
}
impl From<rmp_serde::decode::Error> for DsError {
fn from(e: rmp_serde::decode::Error) -> Self {
Self::SerializationError(e.to_string())
}
}
impl From<psutil::Error> for DsError {
fn from(e: psutil::Error) -> Self {
Self::GenericError(e.to_string())
Expand Down
5 changes: 4 additions & 1 deletion crates/tako/src/internal/tests/integration/utils/task.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use bincode::Options;
use std::path::PathBuf;
use std::time::Duration;

Expand Down Expand Up @@ -99,7 +100,9 @@ pub fn build_task_def_from_config(
stdin: vec![],
cwd,
};
let body = rmp_serde::to_vec(&program_def).unwrap();
let body = bincode::DefaultOptions::new()
.serialize(&program_def)
.unwrap();

let conf = SharedTaskConfiguration {
resources: ResourceRequestVariants {
Expand Down
5 changes: 4 additions & 1 deletion crates/tako/src/internal/tests/integration/utils/worker.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use bincode::Options;
use std::net::{Ipv4Addr, SocketAddr};
use std::path::PathBuf;
use std::sync::Arc;
Expand Down Expand Up @@ -273,7 +274,9 @@ impl TaskLauncher for TestTaskLauncher {
ctx.allocation(),
ctx.body().len(),
);
rmp_serde::from_slice(ctx.body())?
bincode::DefaultOptions::new()
.deserialize(ctx.body())
.map_err(|_| DsError::GenericError("Body deserialization failed".into()))?
};

Ok(TaskLaunchData::from_future(Box::pin(async move {
Expand Down

0 comments on commit 9ff6b91

Please sign in to comment.