commit 38f35235f6ab92fa4ba813f18841ee8c237f8762
parent e274b06c8cad552dfbda1e50789a313d8af5e979
Author: Zack Newman <zack@philomathiclife.com>
Date: Mon, 23 Jun 2025 11:34:10 -0600
more lints
Diffstat:
M | Cargo.toml | | | 65 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- |
M | src/lib.rs | | | 34 | +++------------------------------- |
2 files changed, 65 insertions(+), 34 deletions(-)
diff --git a/Cargo.toml b/Cargo.toml
@@ -10,11 +10,70 @@ name = "tokio_dual_stack"
readme = "README.md"
repository = "https://git.philomathiclife.com/repos/tokio_dual_stack/"
rust-version = "1.86.0"
-version = "0.1.3"
+version = "0.1.4"
+
+[lints.rust]
+ambiguous_negative_literals = { level = "deny", priority = -1 }
+closure_returning_async_block = { level = "deny", priority = -1 }
+deref_into_dyn_supertrait = { level = "deny", priority = -1 }
+ffi_unwind_calls = { level = "deny", priority = -1 }
+future_incompatible = { level = "deny", priority = -1 }
+impl_trait_redundant_captures = { level = "deny", priority = -1 }
+keyword-idents = { level = "deny", priority = -1 }
+let_underscore = { level = "deny", priority = -1 }
+linker_messages = { level = "deny", priority = -1 }
+macro_use_extern_crate = { level = "deny", priority = -1 }
+meta_variable_misuse = { level = "deny", priority = -1 }
+missing_copy_implementations = { level = "deny", priority = -1 }
+missing_debug_implementations = { level = "deny", priority = -1 }
+missing_docs = { level = "deny", priority = -1 }
+non_ascii_idents = { level = "deny", priority = -1 }
+nonstandard_style = { level = "deny", priority = -1 }
+redundant_imports = { level = "deny", priority = -1 }
+redundant_lifetimes = { level = "deny", priority = -1 }
+refining_impl_trait = { level = "deny", priority = -1 }
+rust_2018_compatibility = { level = "deny", priority = -1 }
+rust_2018_idioms = { level = "deny", priority = -1 }
+rust_2021_compatibility = { level = "deny", priority = -1 }
+rust_2024_compatibility = { level = "deny", priority = -1 }
+single_use_lifetimes = { level = "deny", priority = -1 }
+trivial_casts = { level = "deny", priority = -1 }
+trivial_numeric_casts = { level = "deny", priority = -1 }
+unit_bindings = { level = "deny", priority = -1 }
+unknown_lints = { level = "deny", priority = -1 }
+unnameable_types = { level = "deny", priority = -1 }
+unreachable_pub = { level = "deny", priority = -1 }
+unsafe_code = { level = "deny", priority = -1 }
+unstable_features = { level = "deny", priority = -1 }
+unused = { level = "deny", priority = -1 }
+unused_crate_dependencies = { level = "deny", priority = -1 }
+unused_import_braces = { level = "deny", priority = -1 }
+unused_lifetimes = { level = "deny", priority = -1 }
+unused_qualifications = { level = "deny", priority = -1 }
+unused_results = { level = "deny", priority = -1 }
+variant_size_differences = { level = "deny", priority = -1 }
+warnings = { level = "deny", priority = -1 }
+
+[lints.clippy]
+all = { level = "deny", priority = -1 }
+cargo = { level = "deny", priority = -1 }
+complexity = { level = "deny", priority = -1 }
+correctness = { level = "deny", priority = -1 }
+nursery = { level = "deny", priority = -1 }
+pedantic = { level = "deny", priority = -1 }
+perf = { level = "deny", priority = -1 }
+restriction = { level = "deny", priority = -1 }
+style = { level = "deny", priority = -1 }
+suspicious = { level = "deny", priority = -1 }
+# Noisy, opinionated, and likely don't prevent bugs or improve APIs.
+arbitrary_source_item_ordering = "allow"
+blanket_clippy_restriction_lints = "allow"
+implicit_return = "allow"
+return_and_then = "allow"
[dependencies]
pin-project-lite = { version = "0.2.16", default-features = false }
-tokio = { version = "1.44.1", default-features = false, features = ["net"] }
+tokio = { version = "1.45.1", default-features = false, features = ["net"] }
[dev-dependencies]
-tokio = { version = "1.44.1", default-features = false, features = ["macros", "net", "rt"] }
+tokio = { version = "1.45.1", default-features = false, features = ["macros", "net", "rt"] }
diff --git a/src/lib.rs b/src/lib.rs
@@ -26,40 +26,11 @@
//! to `TcpListener::accept` a connection. This has the nice benefit of having a similar API to what a single
//! `TcpListener` would have as well as having similar performance to a socket that does handle both IPv6 and
//! IPv4 requests.
-#![deny(
- unknown_lints,
- future_incompatible,
- let_underscore,
- missing_docs,
- nonstandard_style,
- refining_impl_trait,
- rust_2018_compatibility,
- rust_2018_idioms,
- rust_2021_compatibility,
- rust_2024_compatibility,
- unsafe_code,
- unused,
- warnings,
- clippy::all,
- clippy::cargo,
- clippy::complexity,
- clippy::correctness,
- clippy::nursery,
- clippy::pedantic,
- clippy::perf,
- clippy::restriction,
- clippy::style,
- clippy::suspicious
-)]
#![expect(
- clippy::arbitrary_source_item_ordering,
- clippy::blanket_clippy_restriction_lints,
- clippy::implicit_return,
- clippy::return_and_then,
- reason = "noisy, opinionated, and likely doesn't prevent bugs or improve APIs"
+ clippy::multiple_crate_versions,
+ reason = "dependencies haven't updated to most recent crates"
)]
use core::{
- future::Future,
net::{SocketAddr, SocketAddrV4, SocketAddrV6},
pin::Pin,
sync::atomic::{AtomicBool, Ordering},
@@ -71,6 +42,7 @@ use tokio::net::{self, TcpListener, TcpSocket, TcpStream, ToSocketAddrs};
/// Prevents [`Sealed`] from being publicly implementable.
mod private {
/// Marker trait to prevent [`super::Tcp`] from being publicly implementable.
+ #[expect(unnameable_types, reason = "want Tcp to be 'sealed'")]
pub trait Sealed {}
}
use private::Sealed;