Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: Remove unused crates#26519

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
carols10cents wants to merge2 commits intoinfluxdata:main
base:main
Choose a base branch
Loading
frominteger32llc:cn/remove-unused-crates
Open
Show file tree
Hide file tree
Changes from1 commit
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
PrevPrevious commit
feat: Lint for unused crate dependencies
But allow/expect/explicitly `use as _` for false positives of the lintbecause it isn't possible to currently specify that a dependency is onlyused in unit tests but not integration tests, or only used in abenchmark but not unit tests, or only used in the bin but not the lib.See these issues:- <rust-lang/rust#57274>- <rust-lang/rust#95513>
  • Loading branch information
@carols10cents
carols10cents committedJun 13, 2025
commitf6d9bbe85c6a653ee127a2a13a9f1cb8f48f02fe
1 change: 1 addition & 0 deletionsCargo.toml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -191,6 +191,7 @@ missing_debug_implementations = "deny"
rust_2018_idioms = { level = "deny", priority = -1 }
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tokio_unstable)'] }
unreachable_pub = "deny"
unused_crate_dependencies = "deny"

[workspace.lints.clippy]
clone_on_ref_ptr = "deny"
Expand Down
4 changes: 4 additions & 0 deletionsinfluxdb3/src/main.rs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,6 +9,10 @@ clippy::clone_on_ref_ptr,
// See https://github.com/influxdata/influxdb_iox/pull/1671
clippy::future_not_send
)]
// There are a number of dev dependencies that aren't used in the bin test target, but are used in
// integration test targets. Using `allow` rather than `expect` because there aren't currently
// unused dependencies in the non-test bin target.
#![allow(unused_crate_dependencies)]

use clap::Parser;
use dotenvy::dotenv;
Expand Down
3 changes: 3 additions & 0 deletionsinfluxdb3/tests/lib.rs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
// Tests and benchmarks don't use all the crate dependencies and that's all right.
#![expect(unused_crate_dependencies)]

pub mod cli;
pub mod server;
4 changes: 4 additions & 0 deletionsinfluxdb3_load_generator/src/lib.rs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
// Workaround for unused crate lint; these are only used in the binary crate.
use dotenvy as _;
use observability_deps as _;

pub mod line_protocol_generator;
pub mod query_generator;
pub mod report;
Expand Down
2 changes: 2 additions & 0 deletionsinfluxdb3_load_generator/src/main.rs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,8 @@
clippy::clone_on_ref_ptr,
clippy::future_not_send
)]
// There are many crates only used by the library.
#![expect(unused_crate_dependencies)]

use dotenvy::dotenv;
use observability_deps::tracing::warn;
Expand Down
3 changes: 3 additions & 0 deletionsinfluxdb3_server/src/lib.rs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -282,6 +282,9 @@ pub async fn serve(

#[cfg(test)]
mod tests {
// Workaround for "unused crate" lint false positives; this is only used in integration tests.
use insta as _;

use crate::builder::ServerBuilder;
use crate::query_executor::{CreateQueryExecutorArgs, QueryExecutorImpl};
use crate::serve;
Expand Down
3 changes: 3 additions & 0 deletionsinfluxdb3_server/tests/lib.rs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
// Tests and benchmarks don't use all the crate dependencies and that's all right.
#![expect(unused_crate_dependencies)]

use std::{collections::HashMap, num::NonZeroUsize, sync::Arc, time::Duration};

use arrow_array::RecordBatch;
Expand Down
3 changes: 3 additions & 0 deletionsinfluxdb3_sys_events/benches/store_benchmark.rs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
// Tests and benchmarks don't use all the crate dependencies and that's all right.
#![expect(unused_crate_dependencies)]

use std::{sync::Arc, thread};

use arrow::{
Expand Down
4 changes: 4 additions & 0 deletionsinfluxdb3_sys_events/src/lib.rs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -172,6 +172,10 @@ impl<D> Event<D> {

#[cfg(test)]
mod tests {
// Workaround for "unused crate" lint false positives; these are only used in benches.
use criterion as _;
use rand as _;

use std::sync::Arc;

use arrow::{
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp