Skip to content

Commit

Permalink
Merge branch 'tokio-porting' into PR/tokio-porting
Browse files Browse the repository at this point in the history
  • Loading branch information
Mallets authored Mar 5, 2024
2 parents 15f11b9 + f2e99b6 commit d576751
Show file tree
Hide file tree
Showing 40 changed files with 178 additions and 260 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ jobs:
run: cargo fmt --check

- name: Clippy
run: cargo clippy --all-targets -- --deny warnings
run: cargo +stable clippy --all-targets -- --deny warnings

- name: Clippy unstable targets
run: cargo clippy --all-targets --features unstable -- --deny warnings
run: cargo +stable clippy --all-targets --features unstable -- --deny warnings

- name: Clippy all features
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macOS-latest' }}
run: cargo clippy --all-targets --all-features -- --deny warnings
run: cargo +stable clippy --all-targets --all-features -- --deny warnings

- name: Install generic no_std target
# Generic no_std target architecture is x86_64-unknown-none
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ jobs:
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse

- name: Clippy check
run: cargo clippy --all-targets --features=${{ github.event.inputs.features}} -- --deny warnings
run: cargo +stable clippy --all-targets --features=${{ github.event.inputs.features}} -- --deny warnings

- name: Clippy unstable check
run: cargo clippy --all-targets -- --deny warnings
run: cargo +stable clippy --all-targets -- --deny warnings

- name: Clippy all features
run: cargo clippy --all-targets --all-features -- --deny warnings
run: cargo +stable clippy --all-targets --all-features -- --deny warnings

- name: Environment setup
id: env
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/sync-lockfiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
needs: fetch
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
dependant:
- zenoh-c
Expand Down
102 changes: 2 additions & 100 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 @@ -164,7 +164,7 @@ validated_struct = "2.1.0"
vec_map = "0.8.2"
webpki-roots = "0.26.0"
winapi = { version = "0.3.9", features = ["iphlpapi"] }
z-serial = "0.2.1"
z-serial = "0.2.3"
zenoh-ext = { version = "0.11.0-dev", path = "zenoh-ext" }
zenoh-shm = { version = "0.11.0-dev", path = "commons/zenoh-shm" }
zenoh-result = { version = "0.11.0-dev", path = "commons/zenoh-result", default-features = false }
Expand Down
4 changes: 2 additions & 2 deletions DEFAULT_CONFIG.json5
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@
// interfaces: [ "wlan0" ],
// /// Data flow messages will be processed on. ("egress" or "ingress")
// flow: "egress",
// /// A list of downsampling rules: key_expression and the rate (maximum frequency in Hertz)
// /// A list of downsampling rules: key_expression and the maximum frequency in Hertz
// rules: [
// { key_expr: "demo/example/zenoh-rs-pub", rate: 0.1 },
// { key_expr: "demo/example/zenoh-rs-pub", freq: 0.1 },
// ],
// },
// ],
Expand Down
1 change: 0 additions & 1 deletion commons/zenoh-codec/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ zenoh-shm = { workspace = true, optional = true }
criterion = { workspace = true }
env_logger = { workspace = true }
rand = { workspace = true, features = ["default"] }
uuid = { workspace = true, features = ["default"] }
zenoh-protocol = { workspace = true, features = ["test"] }

[[bench]]
Expand Down
2 changes: 1 addition & 1 deletion commons/zenoh-config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ pub struct DownsamplingRuleConf {
/// Downsampling will be applied for all key extensions if the parameter is None
pub key_expr: OwnedKeyExpr,
/// The maximum frequency in Hertz;
pub rate: f64,
pub freq: f64,
}

#[derive(Debug, Deserialize, Serialize, Clone)]
Expand Down
2 changes: 1 addition & 1 deletion commons/zenoh-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
//! [Click here for Zenoh's documentation](../zenoh/index.html)
pub use lazy_static::lazy_static;
pub mod macros;
pub use macros::*;

use std::future::{Future, Ready};

// Re-exports after moving ZError/ZResult to zenoh-result
Expand Down
5 changes: 3 additions & 2 deletions commons/zenoh-keyexpr/src/key_expr/format/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ impl<'s, Storage: IKeFormatStorage<'s>> KeFormatter<'s, Storage> {
let pattern = segments[i].spec.pattern();
let start = self.buffer.len();
write!(&mut self.buffer, "{value}").unwrap(); // Writing on `&mut String` should be infallible.
match (|| {
let mut set_value = || {
let end = self.buffer.len();
if start == end {
if !pattern.is_double_wild() {
Expand All @@ -529,7 +529,8 @@ impl<'s, Storage: IKeFormatStorage<'s>> KeFormatter<'s, Storage> {
NonMaxU32::new(end.try_into().map_err(|_| ())?).ok_or(())?,
));
Ok(())
})() {
};
match set_value() {
Ok(()) => Ok(self),
Err(()) => {
self.buffer.truncate(start);
Expand Down
6 changes: 3 additions & 3 deletions commons/zenoh-keyexpr/src/key_expr/include.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub struct LTRIncluder;
impl Includer<&[u8], &[u8]> for LTRIncluder {
fn includes(&self, mut left: &[u8], mut right: &[u8]) -> bool {
loop {
let (lchunk, lrest) = left.split_once(&DELIMITER);
let (lchunk, lrest) = Split::split_once(left, &DELIMITER);
let lempty = lrest.is_empty();
if lchunk == DOUBLE_WILD {
if (lempty && !right.has_verbatim()) || (!lempty && self.includes(lrest, right)) {
Expand All @@ -44,12 +44,12 @@ impl Includer<&[u8], &[u8]> for LTRIncluder {
if unsafe { right.has_direct_verbatim_non_empty() } {
return false;
}
right = right.split_once(&DELIMITER).1;
right = Split::split_once(right, &DELIMITER).1;
if right.is_empty() {
return false;
}
} else {
let (rchunk, rrest) = right.split_once(&DELIMITER);
let (rchunk, rrest) = Split::split_once(right, &DELIMITER);
if rchunk.is_empty()
|| rchunk == DOUBLE_WILD
|| !self.non_double_wild_chunk_includes(lchunk, rchunk)
Expand Down
Loading

0 comments on commit d576751

Please sign in to comment.