Skip to content

Commit

Permalink
Moved silencers to the bottom of imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Razz4780 committed Dec 24, 2024
1 parent dc0e7c6 commit 4745bac
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 36 deletions.
12 changes: 6 additions & 6 deletions mirrord/agent/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
#![warn(clippy::indexing_slicing)]
#![deny(unused_crate_dependencies)]

/// Silences `deny(unused_crate_dependencies)`.
///
/// This dependency is only used in integration tests.
#[cfg(test)]
use test_bin as _;

mod cli;
mod client_connection;
mod container_handle;
Expand All @@ -29,9 +35,3 @@ mod watched_task;
async fn main() -> crate::error::Result<()> {
crate::entrypoint::main().await
}

/// Silences `deny(unused_crate_dependencies)`.
///
/// This dependency is only used in integration tests.
#[cfg(test)]
use test_bin as _;
12 changes: 6 additions & 6 deletions mirrord/auth/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
pub use pem;
pub use x509_certificate;

/// Silences `deny(unused_crate_dependencies)`.
/// Although we don't use this dependency directly,
/// compilation fails without it.
#[cfg(feature = "client")]
use k8s_openapi as _;

/// X509 Certificate abstraction for serialization and deserialization
pub mod certificate;
/// FileSystem based storage for multiple credentials (default contents "~/.mirrord/credentials")
Expand All @@ -16,9 +22,3 @@ pub mod credentials;
pub mod error;
/// Public/Private key abstraction for serialization and deserialization
pub mod key_pair;

/// Silences `deny(unused_crate_dependencies)`.
/// Although we don't use this dependency directly,
/// compilation fails without it.
#[cfg(feature = "client")]
use k8s_openapi as _;
20 changes: 10 additions & 10 deletions mirrord/console/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
#![warn(clippy::indexing_slicing)]
#![deny(unused_crate_dependencies)]

#[cfg(feature = "async-logger")]
pub mod async_logger;
pub mod error;
pub mod logger;
pub mod protocol;

#[cfg(feature = "async-logger")]
pub use async_logger::init_async_logger;
pub use logger::init_logger;

/// Silences `deny(unused_crate_dependencies)`.
///
/// These dependencies are only used in the console binary.
Expand All @@ -20,3 +10,13 @@ mod binary_deps {
use tracing as _;
use tracing_subscriber as _;
}

#[cfg(feature = "async-logger")]
pub mod async_logger;
pub mod error;
pub mod logger;
pub mod protocol;

#[cfg(feature = "async-logger")]
pub use async_logger::init_async_logger;
pub use logger::init_logger;
28 changes: 14 additions & 14 deletions mirrord/layer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,20 @@ use crate::{
load::LoadType,
};

/// Silences `deny(unused_crate_dependencies)`.
///
/// These dependencies are only used in integration tests.
#[cfg(test)]
mod integration_tests_deps {
use actix_codec as _;
use futures as _;
use mirrord_intproxy as _;
use tempfile as _;
use test_cdylib as _;
use tests as _;
use tokio as _;
}

mod common;
mod debugger_ports;
mod detour;
Expand Down Expand Up @@ -712,17 +726,3 @@ pub(crate) unsafe extern "C" fn uv_fs_close_detour(
close_layer_fd(fd);
FN_UV_FS_CLOSE(a, b, fd, c)
}

/// Silences `deny(unused_crate_dependencies)`.
///
/// These dependencies are only used in integration tests.
#[cfg(test)]
mod integration_tests_deps {
use actix_codec as _;
use futures as _;
use mirrord_intproxy as _;
use tempfile as _;
use test_cdylib as _;
use tests as _;
use tokio as _;
}

0 comments on commit 4745bac

Please sign in to comment.