Skip to content
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
4 changes: 2 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
rustup override set nightly
cargo miri setup
- name: Test with Miri
run: MIRIFLAGS=-Zmiri-strict-provenance cargo miri test
run: cargo miri test --features nightly

fmt:
runs-on: ubuntu-latest
Expand All @@ -48,7 +48,7 @@ jobs:
strategy:
fail-fast: false
matrix:
rust: [1.82.0, 1.83.0]
rust: [1.85.0, 1.86.0]
timeout-minutes: 45
steps:
- uses: actions/checkout@v5
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ homepage = "https://github.com/contain-rs/trie"
documentation = "https://docs.rs/trie/"
keywords = ["data-structures", "trie", "tree", "collection"]
readme = "README.md"
edition = "2021"
rust-version = "1.82"
edition = "2024"
rust-version = "1.85"

[features]
nightly = []
Expand Down
36 changes: 19 additions & 17 deletions benches/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,17 +132,17 @@ macro_rules! map_find_seq_bench {
};
}

map_insert_rand_bench!{insert_rand_100, 100, Map}
map_insert_rand_bench!{insert_rand_10_000, 10_000, Map}
map_insert_rand_bench! {insert_rand_100, 100, Map}
map_insert_rand_bench! {insert_rand_10_000, 10_000, Map}

map_insert_seq_bench!{insert_seq_100, 100, Map}
map_insert_seq_bench!{insert_seq_10_000, 10_000, Map}
map_insert_seq_bench! {insert_seq_100, 100, Map}
map_insert_seq_bench! {insert_seq_10_000, 10_000, Map}

map_find_rand_bench!{find_rand_100, 100, Map}
map_find_rand_bench!{find_rand_10_000, 10_000, Map}
map_find_rand_bench! {find_rand_100, 100, Map}
map_find_rand_bench! {find_rand_10_000, 10_000, Map}

map_find_seq_bench!{find_seq_100, 100, Map}
map_find_seq_bench!{find_seq_10_000, 10_000, Map}
map_find_seq_bench! {find_seq_100, 100, Map}
map_find_seq_bench! {find_seq_10_000, 10_000, Map}

fn random_map(size: usize) -> Map<usize> {
let mut map = Map::<usize>::new();
Expand Down Expand Up @@ -228,8 +228,12 @@ fn bench_insert_large_entry(b: &mut test::Bencher) {
b.iter(|| {
for _ in 0..MAP_SIZE {
match m.entry(rng.random::<u32>() as usize) {
Occupied(mut e) => { e.insert([1; 10]); },
Vacant(e) => { e.insert([1; 10]); }
Occupied(mut e) => {
e.insert([1; 10]);
}
Vacant(e) => {
e.insert([1; 10]);
}
}
}
});
Expand Down Expand Up @@ -290,9 +294,8 @@ fn bench_get_entry(b: &mut test::Bencher) {
let keys: Vec<usize> = map.keys().collect();
b.iter(|| {
for key in keys.iter() {
match map.entry(*key) {
Occupied(e) => { black_box(e.get()); },
_ => ()
if let Occupied(e) = map.entry(*key) {
black_box(e.get());
}
}
});
Expand All @@ -315,10 +318,9 @@ fn bench_remove_entry(b: &mut test::Bencher) {
let mut map = random_map(MAP_SIZE);
let keys: Vec<usize> = map.keys().collect();
for key in keys.iter() {
match map.entry(*key) {
Occupied(e) => { black_box(e.remove()); },
_ => ()
if let Occupied(e) = map.entry(*key) {
black_box(e.remove());
}
}
});
}
}
11 changes: 0 additions & 11 deletions src/bench.rs

This file was deleted.

8 changes: 2 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,12 @@

//! An ordered map and set based on a trie.

#![cfg_attr(test, feature(unboxed_closures))]
#![cfg_attr(test, feature(fn_traits))]
#![cfg_attr(feature = "nightly", feature(unboxed_closures))]
#![cfg_attr(feature = "nightly", feature(fn_traits))]

pub use map::Map;
pub use set::Set;

#[cfg(test)]
#[macro_use]
mod bench;

pub mod map;
pub mod set;

Expand Down
Loading