mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-27 00:31:35 +00:00
chore: enforce unreachable_pub
lint
The `unreachable_pub` lint makes us aware of uses of `pub` that are not actually reachable from the crate root. This is considered good because it means reading a `pub` somewhere means it is actually public API. Some of our crates are quite large and keeping their entire API surface in your head is difficult. We should strive for most items being `pub(crate)`. This lint helps us enforce that. Pull-Request: #3735.
This commit is contained in:
@ -31,8 +31,7 @@ impl Executor for ThreadPool {
|
||||
not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown"))
|
||||
))]
|
||||
#[derive(Default, Debug, Clone, Copy)]
|
||||
pub struct TokioExecutor;
|
||||
|
||||
pub(crate) struct TokioExecutor;
|
||||
#[cfg(all(
|
||||
feature = "tokio",
|
||||
not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown"))
|
||||
@ -48,8 +47,7 @@ impl Executor for TokioExecutor {
|
||||
not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown"))
|
||||
))]
|
||||
#[derive(Default, Debug, Clone, Copy)]
|
||||
pub struct AsyncStdExecutor;
|
||||
|
||||
pub(crate) struct AsyncStdExecutor;
|
||||
#[cfg(all(
|
||||
feature = "async-std",
|
||||
not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown"))
|
||||
@ -62,8 +60,7 @@ impl Executor for AsyncStdExecutor {
|
||||
|
||||
#[cfg(feature = "wasm-bindgen")]
|
||||
#[derive(Default, Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)]
|
||||
pub struct WasmBindgenExecutor;
|
||||
|
||||
pub(crate) struct WasmBindgenExecutor;
|
||||
#[cfg(feature = "wasm-bindgen")]
|
||||
impl Executor for WasmBindgenExecutor {
|
||||
fn exec(&self, future: Pin<Box<dyn Future<Output = ()> + Send>>) {
|
||||
|
Reference in New Issue
Block a user