Skip to content

Commit 7304747

Browse files
konardclaude
andcommitted
Fix unused BACKGROUND_LINKS import warnings in benchmarks
Moved BACKGROUND_LINKS imports from module-level to inside bench! macro bodies where they are actually used. This eliminates 6 compiler warnings that appeared in CI run #20465184821. The bench! macro already imports BACKGROUND_LINKS internally (lib.rs:18), so module-level imports were redundant. Now each benchmark that uses BACKGROUND_LINKS explicitly imports it within the macro body. Fixes warnings in: - benches/benchmarks/delete.rs - benches/benchmarks/update.rs - benches/benchmarks/each/concrete.rs - benches/benchmarks/each/identity.rs - benches/benchmarks/each/incoming.rs - benches/benchmarks/each/outgoing.rs 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 38cf4d4 commit 7304747

File tree

6 files changed

+12
-6
lines changed

6 files changed

+12
-6
lines changed

rust/benches/benchmarks/delete.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use {
77
split::{self, DataPart, IndexPart},
88
unit, Doublets,
99
},
10-
linksneo4j::{bench, connect, Benched, Client, Exclusive, Fork, Transaction, BACKGROUND_LINKS, LINK_COUNT},
10+
linksneo4j::{bench, connect, Benched, Client, Exclusive, Fork, Transaction, LINK_COUNT},
1111
std::{
1212
alloc::Global,
1313
time::{Duration, Instant},
@@ -21,6 +21,7 @@ fn bench<B: Benched + Doublets<usize>>(
2121
) {
2222
group.bench_function(id, |bencher| {
2323
bench!(|fork| as B {
24+
use linksneo4j::BACKGROUND_LINKS;
2425
// Create additional links beyond background links to delete
2526
for _prepare in BACKGROUND_LINKS..BACKGROUND_LINKS + LINK_COUNT {
2627
let _ = fork.create_point();

rust/benches/benchmarks/each/concrete.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use {
88
split::{self, DataPart, IndexPart},
99
unit, Doublets,
1010
},
11-
linksneo4j::{bench, connect, Benched, Client, Exclusive, Fork, Transaction, BACKGROUND_LINKS},
11+
linksneo4j::{bench, connect, Benched, Client, Exclusive, Fork, Transaction},
1212
std::{
1313
alloc::Global,
1414
time::{Duration, Instant},
@@ -24,6 +24,7 @@ fn bench<B: Benched + Doublets<usize>>(
2424
let any = LinksConstants::new().any;
2525
group.bench_function(id, |bencher| {
2626
bench!(|fork| as B {
27+
use linksneo4j::BACKGROUND_LINKS;
2728
// Query all background links by concrete source/target
2829
for index in 1..=BACKGROUND_LINKS {
2930
elapsed! {fork.each_by([any, index, index], handler)};

rust/benches/benchmarks/each/identity.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use {
88
split::{self, DataPart, IndexPart},
99
unit, Doublets,
1010
},
11-
linksneo4j::{bench, connect, Benched, Client, Exclusive, Fork, Transaction, BACKGROUND_LINKS},
11+
linksneo4j::{bench, connect, Benched, Client, Exclusive, Fork, Transaction},
1212
std::{
1313
alloc::Global,
1414
time::{Duration, Instant},
@@ -24,6 +24,7 @@ fn bench<B: Benched + Doublets<usize>>(
2424
let any = LinksConstants::new().any;
2525
group.bench_function(id, |bencher| {
2626
bench!(|fork| as B {
27+
use linksneo4j::BACKGROUND_LINKS;
2728
// Query all background links by identity
2829
for index in 1..=BACKGROUND_LINKS {
2930
elapsed! {fork.each_by([index, any, any], handler)};

rust/benches/benchmarks/each/incoming.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use {
88
split::{self, DataPart, IndexPart},
99
unit, Doublets,
1010
},
11-
linksneo4j::{bench, connect, Benched, Client, Exclusive, Fork, Transaction, BACKGROUND_LINKS},
11+
linksneo4j::{bench, connect, Benched, Client, Exclusive, Fork, Transaction},
1212
std::{
1313
alloc::Global,
1414
time::{Duration, Instant},
@@ -24,6 +24,7 @@ fn bench<B: Benched + Doublets<usize>>(
2424
let any = LinksConstants::new().any;
2525
group.bench_function(id, |bencher| {
2626
bench!(|fork| as B {
27+
use linksneo4j::BACKGROUND_LINKS;
2728
// Query all background links by incoming (target)
2829
for index in 1..=BACKGROUND_LINKS {
2930
elapsed! {fork.each_by([any, any, index], handler)};

rust/benches/benchmarks/each/outgoing.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use {
88
split::{self, DataPart, IndexPart},
99
unit, Doublets,
1010
},
11-
linksneo4j::{bench, connect, Benched, Client, Exclusive, Fork, Transaction, BACKGROUND_LINKS},
11+
linksneo4j::{bench, connect, Benched, Client, Exclusive, Fork, Transaction},
1212
std::{
1313
alloc::Global,
1414
time::{Duration, Instant},
@@ -24,6 +24,7 @@ fn bench<B: Benched + Doublets<usize>>(
2424
let any = LinksConstants::new().any;
2525
group.bench_function(id, |bencher| {
2626
bench!(|fork| as B {
27+
use linksneo4j::BACKGROUND_LINKS;
2728
// Query all background links by outgoing (source)
2829
for index in 1..=BACKGROUND_LINKS {
2930
let _ = elapsed! {fork.each_by([any, index, any], handler)};

rust/benches/benchmarks/update.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use {
77
split::{self, DataPart, IndexPart},
88
unit, Doublets,
99
},
10-
linksneo4j::{bench, connect, Benched, Client, Exclusive, Fork, Transaction, BACKGROUND_LINKS, LINK_COUNT},
10+
linksneo4j::{bench, connect, Benched, Client, Exclusive, Fork, Transaction, LINK_COUNT},
1111
std::{
1212
alloc::Global,
1313
time::{Duration, Instant},
@@ -21,6 +21,7 @@ fn bench<B: Benched + Doublets<usize>>(
2121
) {
2222
group.bench_function(id, |bencher| {
2323
bench!(|fork| as B {
24+
use linksneo4j::BACKGROUND_LINKS;
2425
// Update the last LINK_COUNT links from background links
2526
let start_id = if BACKGROUND_LINKS > LINK_COUNT { BACKGROUND_LINKS - LINK_COUNT + 1 } else { 1 };
2627
for id in start_id..=BACKGROUND_LINKS {

0 commit comments

Comments
 (0)