Skip to content

Commit

Permalink
Allow custom configs (#128)
Browse files Browse the repository at this point in the history
Fix several rustc and clippy warnings

* Allow custom configs
* Fix clippy warnings
* Bump MSRV to 1.70
* Collect neighbors vec in benches
  • Loading branch information
s1ck authored Nov 27, 2024
1 parent 9bffe05 commit 3643e41
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ authors = [
"Martin Junghanns <[email protected]>",
"Paul Horn <[email protected]>",
]
rust-version = "1.65"
rust-version = "1.70"
repository = "https://github.com/neo4j-labs/graph"
edition = "2021"
license = "MIT"
Expand Down
4 changes: 2 additions & 2 deletions crates/app/src/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ macro_rules! gen_runner {
};

(__run_file_format_all: $algo_config:ty, $ev_type:ty) => {
fn run_<NI: Idx>(
fn run_<NI>(
args: $crate::CommonArgs,
config: $algo_config,
) -> ::kommandozeile::Result<()>
Expand All @@ -58,7 +58,7 @@ macro_rules! gen_runner {
};

(__run_file_format_edge_list: $algo_config:ty, $ev_type:ty) => {
fn run_<NI: Idx>(
fn run_<NI>(
args: $crate::CommonArgs,
config: $algo_config,
) -> ::kommandozeile::Result<()>
Expand Down
8 changes: 8 additions & 0 deletions crates/builder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ tokio.workspace = true
force_fallback_impl = []
dotgraph = []

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = [
'cfg(has_new_uninit)',
'cfg(has_maybe_uninit_write_slice)',
'cfg(has_slice_partition_dedup)',
'cfg(has_doc_cfg)',
] }

[[bench]]
name = "edgelist"
harness = false
Expand Down
2 changes: 1 addition & 1 deletion crates/builder/benches/topology.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ fn bench_all_targets<G>(
Direction::Incoming => graph.in_neighbors(node),
Direction::Undirected => unreachable!(),
};
black_box(neighbors);
black_box(neighbors.collect::<Vec<_>>());
}
},
criterion::BatchSize::SmallInput,
Expand Down
2 changes: 1 addition & 1 deletion crates/builder/src/input/edgelist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ where
I: IntoIterator<Item = (NI, NI, EV)>,
{
fn from(iter: EdgeWithValueIterator<NI, EV, I>) -> Self {
EdgeList::new(iter.0.into_iter().map(|(s, t, v)| (s, t, v)).collect())
EdgeList::new(iter.0.into_iter().collect())
}
}

Expand Down

0 comments on commit 3643e41

Please sign in to comment.