-
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.
fix package-scale compilation for subcrates, make ketrees generic ove…
…r their hasher
- Loading branch information
Showing
5 changed files
with
22 additions
and
9 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,25 @@ | |
// ZettaScale Zenoh Team, <[email protected]> | ||
// | ||
|
||
use core::hash::Hasher; | ||
#[cfg(not(feature = "std"))] | ||
use hashbrown::{ | ||
hash_map::{Entry, Iter, IterMut, Values, ValuesMut}, | ||
hash_map::{DefaultHasher, Entry, Iter, IterMut, Values, ValuesMut}, | ||
Check failure on line 18 in commons/zenoh-keyexpr/src/keyexpr_tree/impls/hashmap_impl.rs GitHub Actions / Run no_std checks
|
||
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>( | ||
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,19 @@ | |
// ZettaScale Zenoh Team, <[email protected]> | ||
// | ||
|
||
use core::hash::Hasher; | ||
#[cfg(not(feature = "std"))] | ||
use hashbrown::hash_map::DefaultHasher; | ||
Check failure on line 17 in commons/zenoh-keyexpr/src/keyexpr_tree/impls/keyed_set_impl.rs GitHub Actions / Run no_std checks
|
||
#[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>( | ||
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