Skip to content

Commit be27586

Browse files
Ahash bump - follow up of #46 (#47)
* bump ahash crate to fix build currently, cargo build generates the following error due to the removal of stdsim: rust-lang/rust#117372 * fix clippy errors * attempt to fix formatting * attempt to not parallelize he intersection * remove rayon prelude * chore(cargo): update dependencies and modernize crate * chore(cargo): update lock via cargo update --------- Co-authored-by: Clément Michaud <clement.michaud34@gmail.com>
1 parent e8be7ca commit be27586

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+599
-395
lines changed

Cargo.lock

Lines changed: 205 additions & 286 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,26 @@ rust-version = "1.56"
1313
version = "2.1.2"
1414

1515
[dependencies]
16-
ahash = "0.8.3"
17-
indexmap = { version = "2.0.0", features = ["rayon"] }
18-
itertools = "0.11.0"
16+
ahash = "0.8.11"
17+
indexmap = { version = "2.6.0", features = ["rayon"] }
18+
itertools = "0.13.0"
1919
rayon = "1.7.0"
20-
thiserror = "1.0.47"
20+
thiserror = "2.0.3"
2121

2222
[dev-dependencies]
2323
criterion = "0.5.1"
2424

2525
[[bench]]
2626
name = "performance"
2727
harness = false
28+
29+
[lints.rust]
30+
missing_debug_implementations = "warn"
31+
missing_docs = "warn"
32+
nonstandard_style = { level = "deny", priority= -1 }
33+
rust_2021_compatibility = { level = "forbid", priority= -1 }
34+
unreachable_pub = "warn"
35+
unsafe_code = "deny"
36+
37+
[lints.clippy]
38+
all = "deny"

benches/performance.rs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
11
#![deny(unsafe_code, nonstandard_style)]
22

3-
use std::fmt::{Display, Formatter, Result};
4-
5-
use criterion::{criterion_group, criterion_main, Criterion};
6-
use hypergraph::{HyperedgeIndex, Hypergraph, VertexIndex};
3+
use std::fmt::{
4+
Display,
5+
Formatter,
6+
Result,
7+
};
8+
9+
use criterion::{
10+
Criterion,
11+
criterion_group,
12+
criterion_main,
13+
};
14+
use hypergraph::{
15+
HyperedgeIndex,
16+
Hypergraph,
17+
VertexIndex,
18+
};
719
use itertools::Itertools;
820

921
static HYPEREDGES: usize = 10_000;

rustfmt.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
edition = "2021"
22
group_imports = "StdExternalCrate"
33
imports_granularity = "Crate"
4+
imports_layout="Vertical"
45
use_field_init_shorthand = true
5-
version = "Two"
6+
style_edition = "2024"

src/core/bi_hash_map.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
use std::{collections::HashMap, fmt::Debug};
1+
use std::{
2+
collections::HashMap,
3+
fmt::Debug,
4+
};
25

36
/// Bi-directional hashmap used to store the mapping between the internal
47
/// unstable indexes - generated by `IndexMap` and `IndexSet` - and the exposed

src/core/errors.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
use thiserror::Error;
22

3-
use crate::{HyperedgeIndex, VertexIndex};
3+
use crate::{
4+
HyperedgeIndex,
5+
VertexIndex,
6+
};
47

58
/// Enumeration of all the possible errors.
69
#[derive(Clone, Debug, Eq, Error, PartialEq)]
@@ -9,7 +12,7 @@ where
912
V: Copy + Eq,
1013
HE: Copy + Eq,
1114
{
12-
/// Error when a HyperedgeIndex was not found.
15+
/// Error when a `HyperedgeIndex` was not found.
1316
#[error("HyperedgeIndex {0} was not found")]
1417
HyperedgeIndexNotFound(HyperedgeIndex),
1518

@@ -66,7 +69,7 @@ where
6669
#[error("At least two hyperedges must be provided to be joined")]
6770
HyperedgesInvalidJoin,
6871

69-
/// Error when a VertexIndex was not found.
72+
/// Error when a `VertexIndex` was not found.
7073
#[error("VertexIndex {0} was not found")]
7174
VertexIndexNotFound(VertexIndex),
7275

src/core/hyperedges/add_hyperedge.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
use crate::{
2-
errors::HypergraphError, HyperedgeIndex, HyperedgeKey, HyperedgeTrait, Hypergraph, VertexIndex,
2+
HyperedgeIndex,
3+
HyperedgeKey,
4+
HyperedgeTrait,
5+
Hypergraph,
6+
VertexIndex,
37
VertexTrait,
8+
errors::HypergraphError,
49
};
510

611
impl<V, HE> Hypergraph<V, HE>

src/core/hyperedges/add_hyperedge_index.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
use crate::{HyperedgeIndex, HyperedgeTrait, Hypergraph, VertexTrait};
1+
use crate::{
2+
HyperedgeIndex,
3+
HyperedgeTrait,
4+
Hypergraph,
5+
VertexTrait,
6+
};
27

38
impl<V, HE> Hypergraph<V, HE>
49
where

src/core/hyperedges/clear_hyperedges.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
use rayon::prelude::*;
22

33
use crate::{
4-
bi_hash_map::BiHashMap, errors::HypergraphError, HyperedgeTrait, Hypergraph, VertexTrait,
4+
HyperedgeTrait,
5+
Hypergraph,
6+
VertexTrait,
7+
bi_hash_map::BiHashMap,
8+
errors::HypergraphError,
59
};
610

711
impl<V, HE> Hypergraph<V, HE>

src/core/hyperedges/contract_hyperedge_vertices.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@ use itertools::Itertools;
22
use rayon::prelude::*;
33

44
use crate::{
5-
core::utils::are_slices_equal, errors::HypergraphError, HyperedgeIndex, HyperedgeTrait,
6-
Hypergraph, VertexIndex, VertexTrait,
5+
HyperedgeIndex,
6+
HyperedgeTrait,
7+
Hypergraph,
8+
VertexIndex,
9+
VertexTrait,
10+
core::utils::are_slices_equal,
11+
errors::HypergraphError,
712
};
813

914
impl<V, HE> Hypergraph<V, HE>

0 commit comments

Comments
 (0)