Skip to content

Commit

Permalink
fix no_std and transport_compression feature breaking compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
p-avital committed Oct 4, 2023
1 parent 2005568 commit 60b00f3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
6 changes: 5 additions & 1 deletion commons/zenoh-keyexpr/src/keyexpr_tree/impls/hashmap_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@

use core::hash::Hasher;
#[cfg(not(feature = "std"))]
// `SipHasher` is deprecated in favour of a symbol that only exists in `std`
#[allow(deprecated)]
use core::hash::SipHasher as DefaultHasher;
#[cfg(not(feature = "std"))]
use hashbrown::{
hash_map::{DefaultHasher, Entry, Iter, IterMut, Values, ValuesMut},
hash_map::{Entry, Iter, IterMut, Values, ValuesMut},
HashMap,
};
#[cfg(feature = "std")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@

use core::hash::Hasher;
#[cfg(not(feature = "std"))]
use hashbrown::hash_map::DefaultHasher;
// `SipHasher` is deprecated in favour of a symbol that only exists in `std`
#[allow(deprecated)]
use core::hash::SipHasher as DefaultHasher;
#[cfg(feature = "std")]
use std::collections::hash_map::DefaultHasher;

Expand Down
4 changes: 4 additions & 0 deletions io/zenoh-transport/src/unicast/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ pub struct TransportManagerBuilderUnicast {
pub(super) max_links: usize,
#[cfg(feature = "shared-memory")]
pub(super) is_shm: bool,
#[cfg(feature = "transport_compression")]
pub(super) is_compressed: bool,
#[cfg(feature = "transport_auth")]
pub(super) authenticator: Auth,
pub(super) is_lowlatency: bool,
Expand Down Expand Up @@ -251,6 +253,8 @@ impl Default for TransportManagerBuilderUnicast {
max_links: *transport.max_links(),
#[cfg(feature = "shared-memory")]
is_shm: *shm.enabled(),
#[cfg(feature = "transport_compression")]
is_compressed: false,
#[cfg(feature = "transport_auth")]
authenticator: Auth::default(),
is_lowlatency: *transport.lowlatency(),
Expand Down
2 changes: 1 addition & 1 deletion io/zenoh-transport/src/unicast/universal/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ impl TransportLinkUnicast {
};

#[cfg(all(feature = "unstable", feature = "transport_compression"))]
let is_compressed = self.transport.config.manager.config.unicast.is_compressed;
let is_compressed = self.transport.manager.config.unicast.is_compressed;

// The pipeline
let (producer, consumer) = TransmissionPipeline::make(config, priority_tx);
Expand Down

0 comments on commit 60b00f3

Please sign in to comment.