Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use triomphe::Arc by default. #88

Merged
merged 2 commits into from
Nov 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ include = [
codecov = { repository = "orium/rpds", branch = "main", service = "github" }

[dependencies]
archery = "1.0.0"
archery = { version = "1.1.0", features = ["triomphe"] }
serde = { version = "1.0.149", optional = true, default-features = false }

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ crate to do this in a convenient way.
The pointer type can be parameterized like this:

```rust
let vec: Vector<u32, archery::ArcK> = Vector::new_with_ptr_kind();
let vec: Vector<u32, archery::ArcTK> = Vector::new_with_ptr_kind();
// ↖
// This will use `Arc` pointers.
// Change it to `archery::RcK` to use a `Rc` pointer.
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@
//! ```rust
//! # use rpds::Vector;
//! #
//! let vec: Vector<u32, archery::ArcK> = Vector::new_with_ptr_kind();
//! let vec: Vector<u32, archery::ArcTK> = Vector::new_with_ptr_kind();
//! // ↖
//! // This will use `Arc` pointers.
//! // Change it to `archery::RcK` to use a `Rc` pointer.
Expand Down
4 changes: 2 additions & 2 deletions src/list/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ macro_rules! list {
#[macro_export]
macro_rules! list_sync {
($($e:expr),*) => {
$crate::list_reverse!(::archery::ArcK ; $($e),* ; )
$crate::list_reverse!(::archery::ArcTK ; $($e),* ; )
};
}

Expand Down Expand Up @@ -137,7 +137,7 @@ where
}
}

pub type ListSync<T> = List<T, ArcK>;
pub type ListSync<T> = List<T, ArcTK>;

impl<T> ListSync<T> {
#[must_use]
Expand Down
4 changes: 2 additions & 2 deletions src/map/hash_trie_map/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::list;
use crate::utils::DefaultBuildHasher;
use crate::List;
use alloc::vec::Vec;
use archery::{ArcK, RcK, SharedPointer, SharedPointerKind};
use archery::{ArcTK, RcK, SharedPointer, SharedPointerKind};
use core::borrow::Borrow;
use core::fmt::Display;
use core::hash::BuildHasher;
Expand Down Expand Up @@ -126,7 +126,7 @@ where
hasher_builder: H,
}

pub type HashTrieMapSync<K, V, H = DefaultBuildHasher> = HashTrieMap<K, V, ArcK, H>;
pub type HashTrieMapSync<K, V, H = DefaultBuildHasher> = HashTrieMap<K, V, ArcTK, H>;

/// This map works like a trie that breaks the hash of the key in segments, and the segments are
/// used as the index in the trie branches.
Expand Down
4 changes: 2 additions & 2 deletions src/map/red_black_tree_map/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

use super::entry::Entry;
use archery::{ArcK, RcK, SharedPointer, SharedPointerKind};
use archery::{ArcTK, RcK, SharedPointer, SharedPointerKind};
use core::borrow::Borrow;
use core::cmp::Ordering;
use core::fmt::Display;
Expand Down Expand Up @@ -113,7 +113,7 @@ where
size: usize,
}

pub type RedBlackTreeMapSync<K, V> = RedBlackTreeMap<K, V, ArcK>;
pub type RedBlackTreeMapSync<K, V> = RedBlackTreeMap<K, V, ArcTK>;

#[derive(Clone, Copy, Debug, PartialEq, Eq)]
enum Color {
Expand Down
2 changes: 1 addition & 1 deletion src/queue/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ where
out_list: List<T, P>,
}

pub type QueueSync<T> = Queue<T, ArcK>;
pub type QueueSync<T> = Queue<T, ArcTK>;

impl<T> QueueSync<T> {
#[must_use]
Expand Down
4 changes: 2 additions & 2 deletions src/set/hash_trie_set/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use crate::map::hash_trie_map;
use crate::utils::DefaultBuildHasher;
use crate::HashTrieMap;
use archery::{ArcK, RcK, SharedPointerKind};
use archery::{ArcTK, RcK, SharedPointerKind};
use core::borrow::Borrow;
use core::fmt::Display;
use core::hash::BuildHasher;
Expand Down Expand Up @@ -104,7 +104,7 @@ where
map: HashTrieMap<T, (), P, H>,
}

pub type HashTrieSetSync<T, H = DefaultBuildHasher> = HashTrieSet<T, ArcK, H>;
pub type HashTrieSetSync<T, H = DefaultBuildHasher> = HashTrieSet<T, ArcTK, H>;

impl<T> HashTrieSet<T, RcK, DefaultBuildHasher>
where
Expand Down
4 changes: 2 additions & 2 deletions src/set/red_black_tree_set/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

use crate::map::red_black_tree_map;
use crate::RedBlackTreeMap;
use archery::{ArcK, RcK, SharedPointerKind};
use archery::{ArcTK, RcK, SharedPointerKind};
use core::borrow::Borrow;
use core::cmp::Ordering;
use core::fmt::Display;
Expand Down Expand Up @@ -104,7 +104,7 @@ where
map: RedBlackTreeMap<T, (), P>,
}

pub type RedBlackTreeSetSync<T> = RedBlackTreeSet<T, ArcK>;
pub type RedBlackTreeSetSync<T> = RedBlackTreeSet<T, ArcTK>;

impl<T> RedBlackTreeSetSync<T>
where
Expand Down
2 changes: 1 addition & 1 deletion src/stack/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ where
list: List<T, P>,
}

pub type StackSync<T> = Stack<T, ArcK>;
pub type StackSync<T> = Stack<T, ArcTK>;

impl<T> StackSync<T> {
#[must_use]
Expand Down
2 changes: 1 addition & 1 deletion src/vector/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ where
length: usize,
}

pub type VectorSync<T> = Vector<T, ArcK>;
pub type VectorSync<T> = Vector<T, ArcTK>;

#[derive(Debug)]
enum Node<T, P = RcK>
Expand Down