Skip to content

Commit b168af5

Browse files
committed
Fix compilation warning
1 parent 193a66a commit b168af5

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎rules/map/shim.rs‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ impl<K, T> Map<K, T> {
180180
}
181181

182182
type Entry<K, V> = (Value<K>, Value<V>);
183+
type EntryNode<K, V> = Value<MapNode<Entry<K, V>>>;
183184

184185
impl<K: Ord, V> Map<K, Entry<K, V>> {
185186
fn link_after(
@@ -201,10 +202,7 @@ impl<K: Ord, V> Map<K, Entry<K, V>> {
201202
}
202203

203204
// The node with the given key, or else the node after which it goes.
204-
fn search(
205-
&self,
206-
key: &K,
207-
) -> Result<Value<MapNode<Entry<K, V>>>, Value<MapNode<Entry<K, V>>>> {
205+
fn search(&self, key: &K) -> Result<EntryNode<K, V>, EntryNode<K, V>> {
208206
let key: &dyn MapKey<K> = key;
209207
match self
210208
.nodes
@@ -469,6 +467,8 @@ impl<K, T> UnsafeMap<K, T> {
469467
}
470468
}
471469

470+
type UnsafeEntryNode<K, V> = *mut UnsafeMapNode<(K, V)>;
471+
472472
impl<K: Ord, V> UnsafeMap<K, (K, V)> {
473473
fn link_after(
474474
&mut self,
@@ -492,7 +492,7 @@ impl<K: Ord, V> UnsafeMap<K, (K, V)> {
492492
}
493493

494494
// The node with the given key, or else the node after which it goes.
495-
fn search(&self, key: &K) -> Result<*mut UnsafeMapNode<(K, V)>, *mut UnsafeMapNode<(K, V)>> {
495+
fn search(&self, key: &K) -> Result<UnsafeEntryNode<K, V>, UnsafeEntryNode<K, V>> {
496496
let key = UnsafeMapKey(key);
497497
match self.nodes.range(..=&key).next_back() {
498498
Some((k, node)) => {

0 commit comments

Comments
 (0)