-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #560 from eclipse-zenoh/minor-fixes
fix package-scale compilation for subcrates, make ketrees generic over their hasher
- Loading branch information
Showing
8 changed files
with
33 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,22 +12,29 @@ | |
// ZettaScale Zenoh Team, <[email protected]> | ||
// | ||
|
||
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::{Entry, Iter, IterMut, Values, ValuesMut}, | ||
HashMap, | ||
}; | ||
#[cfg(feature = "std")] | ||
use std::collections::{ | ||
hash_map::{Entry, Iter, IterMut, Values, ValuesMut}, | ||
hash_map::{DefaultHasher, Entry, Iter, IterMut, Values, ValuesMut}, | ||
HashMap, | ||
}; | ||
|
||
use crate::keyexpr_tree::*; | ||
|
||
pub struct HashMapProvider; | ||
impl<T: 'static> IChildrenProvider<T> for HashMapProvider { | ||
type Assoc = HashMap<OwnedKeyExpr, T>; | ||
pub struct HashMapProvider<Hash: Hasher + Default + 'static = DefaultHasher>( | ||
Check warning on line 33 in commons/zenoh-keyexpr/src/keyexpr_tree/impls/hashmap_impl.rs GitHub Actions / Run no_std checks
|
||
core::marker::PhantomData<Hash>, | ||
); | ||
impl<T: 'static, Hash: Hasher + Default + 'static> IChildrenProvider<T> for HashMapProvider<Hash> { | ||
type Assoc = HashMap<OwnedKeyExpr, T, core::hash::BuildHasherDefault<Hash>>; | ||
} | ||
|
||
#[cfg(not(feature = "std"))] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,11 +12,21 @@ | |
// ZettaScale Zenoh Team, <[email protected]> | ||
// | ||
|
||
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(feature = "std")] | ||
use std::collections::hash_map::DefaultHasher; | ||
|
||
use crate::keyexpr_tree::*; | ||
use keyed_set::{KeyExtractor, KeyedSet}; | ||
|
||
pub struct KeyedSetProvider; | ||
impl<T: 'static> IChildrenProvider<T> for KeyedSetProvider { | ||
pub struct KeyedSetProvider<Hash: Hasher + Default + 'static = DefaultHasher>( | ||
Check warning on line 26 in commons/zenoh-keyexpr/src/keyexpr_tree/impls/keyed_set_impl.rs GitHub Actions / Run no_std checks
|
||
core::marker::PhantomData<Hash>, | ||
); | ||
impl<T: 'static, Hash: Hasher + Default + 'static> IChildrenProvider<T> for KeyedSetProvider<Hash> { | ||
type Assoc = KeyedSet<T, ChunkExtractor>; | ||
} | ||
#[derive(Debug, Default, Clone, Copy)] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters