Skip to content

Commit

Permalink
Expose implementation details because I can't not
Browse files Browse the repository at this point in the history
  • Loading branch information
neutr0nst4r committed Apr 13, 2024
1 parent 0a7fb0b commit 475c0db
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
3 changes: 0 additions & 3 deletions src/fixed_map/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,14 @@ use std::mem::MaybeUninit;
use std::{mem, slice};

/// A fixed map with overflow which uses the default allocator as an overflow.
#[allow(private_interfaces)]
pub type DefaultFixedMapWithOverflow<K, V, const NODE_COUNT: usize, C> =
FixedMapWithOverflow<K, V, NODE_COUNT, DefaultAllocator, C>;

/// A fixed map without overflow.
#[allow(private_interfaces)]
pub type FixedMap<K, V, const NODE_COUNT: usize, C = Less<K>> =
FixedMapImpl<K, V, NODE_COUNT, FixedPool<Node<K, V>>, C>;

/// A fixed map with overflow using the given overflow allocator.
#[allow(private_interfaces)]
pub type FixedMapWithOverflow<K, V, const NODE_COUNT: usize, OverflowAllocator, C = Less<K>> =
FixedMapImpl<K, V, NODE_COUNT, FixedPoolWithOverflow<Node<K, V>, OverflowAllocator>, C>;

Expand Down
6 changes: 3 additions & 3 deletions src/internal/rb_tree/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::{fmt::Debug, marker::PhantomData, ptr};
/// The color of a red-black tree node
#[repr(C)]
#[derive(Debug, Eq, PartialEq)]
pub(crate) enum Color {
pub enum Color {
Red = 0,
Black = 1,
}
Expand All @@ -22,7 +22,7 @@ impl From<u32> for Color {
/// A parent-color compressed pair. Combined, the
/// pair takes `std::mem::size_of::<usize>()` bytes
#[repr(C)]
pub(crate) struct ParentColor<K, V> {
pub struct ParentColor<K, V> {
raw_ptr: usize,
_ignore_key: PhantomData<K>,
_ignore_value: PhantomData<V>,
Expand Down Expand Up @@ -84,7 +84,7 @@ impl<K, V> Default for ParentColor<K, V> {

#[repr(C)]
#[derive(Debug)]
pub(crate) struct Node<K, V> {
pub struct Node<K, V> {
pub right: *mut Node<K, V>,
pub left: *mut Node<K, V>,
pub parent: ParentColor<K, V>,
Expand Down

0 comments on commit 475c0db

Please sign in to comment.