Skip to content

Commit

Permalink
feat!: move serialization into zenoh-ext
Browse files Browse the repository at this point in the history
  • Loading branch information
wyfo committed Sep 25, 2024
1 parent 965e905 commit 3938495
Show file tree
Hide file tree
Showing 48 changed files with 1,062 additions and 3,811 deletions.
69 changes: 54 additions & 15 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 @@ -176,7 +176,6 @@ tokio-rustls = { version = "0.26.0", default-features = false }
thread-priority = "1.1.0"
typenum = "1.17.0"
uhlc = { version = "0.8.0", default-features = false } # Default features are disabled due to usage in no_std crates
unwrap-infallible = "0.1.5"
unzip-n = "0.1.2"
url = "2.5.2"
urlencoding = "2.1.3"
Expand Down
4 changes: 2 additions & 2 deletions ci/valgrind-check/src/pub_sub/bin/z_pub_sub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ async fn main() {
sample.key_expr().as_str(),
sample
.payload()
.deserialize::<String>()
.unwrap_or_else(|e| format!("{}", e))
.try_to_string()
.unwrap_or_else(|e| e.to_string().into())
);
})
.await
Expand Down
8 changes: 4 additions & 4 deletions ci/valgrind-check/src/queryable_get/bin/z_queryable_get.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ async fn main() {
sample.key_expr().as_str(),
sample
.payload()
.deserialize::<String>()
.unwrap_or_else(|e| format!("{}", e))
.try_to_string()
.unwrap_or_else(|e| e.to_string().into())
),
Err(err) => println!(
">> Received (ERROR: '{}')",
err.payload()
.deserialize::<String>()
.unwrap_or_else(|e| format!("{}", e))
.try_to_string()
.unwrap_or_else(|e| e.to_string().into())
),
}
}
Expand Down
2 changes: 1 addition & 1 deletion commons/zenoh-buffers/src/zbuf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ impl<'a> io::Seek for ZBufReader<'a> {
.fold(0, |acc, s| acc + s.len())
+ self.cursor.byte;
let current_pos = i64::try_from(current_pos)
.map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, format!("{}", e)))?;
.map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e.to_string()))?;

let offset = match pos {
std::io::SeekFrom::Start(s) => i64::try_from(s).unwrap_or(i64::MAX) - current_pos,
Expand Down
2 changes: 1 addition & 1 deletion examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ prost = { workspace = true }
serde_json = { workspace = true }
serde_yaml = { workspace = true }
tokio = { workspace = true, features = ["rt-multi-thread", "time", "io-std"] }
unwrap-infallible = { workspace = true }
zenoh = { workspace = true, default-features = true }
zenoh-ext = { workspace = true }

Expand All @@ -47,6 +46,7 @@ rand = { workspace = true, features = ["default"] }

[build-dependencies]
rustc_version = { workspace = true }
prost-build = "0.13.3"

[[example]]
name = "z_scout"
Expand Down
4 changes: 4 additions & 0 deletions examples/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
fn main() -> std::io::Result<()> {
prost_build::compile_protos(&["examples/example.proto"], &["examples/"])?;
Ok(())
}
Loading

0 comments on commit 3938495

Please sign in to comment.