Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test pr #1481

Closed
Closed

test pr #1481

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 80 additions & 16 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ json5 = "0.4.1"
jsonschema = { version = "0.20", default-features = false }
keyed-set = "1.0.0"
lazy_static = "1.5.0"
leb128 = "0.2"
libc = "0.2.158"
libloading = "0.8"
tracing = "0.1"
Expand Down Expand Up @@ -176,7 +177,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
6 changes: 5 additions & 1 deletion commons/zenoh-buffers/src/zbuf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ impl ZBuf {
self.slices.as_mut().iter_mut()
}

pub fn into_zslices(self) -> impl Iterator<Item = ZSlice> {
self.slices.into_iter()
}

pub fn push_zslice(&mut self, zslice: ZSlice) {
if !zslice.is_empty() {
self.slices.push(zslice);
Expand Down Expand Up @@ -404,7 +408,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
4 changes: 2 additions & 2 deletions examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ 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 }

[dev-dependencies]
rand = { workspace = true, features = ["default"] }

[build-dependencies]
rustc_version = { workspace = true }
prost-build = "0.13"
which = "6"

[[example]]
name = "z_scout"
Expand Down
16 changes: 16 additions & 0 deletions examples/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
use std::{env, fs::File, io::Write, path::Path};

use which::which;

fn main() -> std::io::Result<()> {
// If protoc is not installed, we cheat because building protoc from source
// with protobuf-src is way too long
if which("protoc").is_err() {
const PROTO: &str = r#"#[derive(Clone, PartialEq, ::prost::Message)] pub struct Entity { #[prost(uint32, tag = "1")] pub id: u32, #[prost(string, tag = "2")] pub name: ::prost::alloc::string::String,}"#;
let out_path = Path::new(&env::var("OUT_DIR").unwrap()).join("example.rs");
File::create(out_path)?.write_all(PROTO.as_bytes())?;
return Ok(());
}
prost_build::compile_protos(&["examples/example.proto"], &["examples/"])?;
Ok(())
}
Loading
Loading