mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: add and fix more lints, improve docs (#4765)
This commit is contained in:
@ -1,22 +1,18 @@
|
||||
#![cfg_attr(docsrs, feature(doc_cfg))]
|
||||
#![doc(
|
||||
html_logo_url = "https://raw.githubusercontent.com/paradigmxyz/reth/main/assets/reth-docs.png",
|
||||
html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
|
||||
issue_tracker_base_url = "https://github.com/paradigmxzy/reth/issues/"
|
||||
)]
|
||||
#![warn(missing_docs, unused_crate_dependencies)]
|
||||
#![deny(unused_must_use, rust_2018_idioms)]
|
||||
#![doc(test(
|
||||
no_crate_inject,
|
||||
attr(deny(warnings, rust_2018_idioms), allow(dead_code, unused_variables))
|
||||
))]
|
||||
|
||||
//! Helpers for resolving the external IP.
|
||||
//!
|
||||
//! ## Feature Flags
|
||||
//!
|
||||
//! - `serde` (default): Enable serde support
|
||||
|
||||
#![doc(
|
||||
html_logo_url = "https://raw.githubusercontent.com/paradigmxyz/reth/main/assets/reth-docs.png",
|
||||
html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
|
||||
issue_tracker_base_url = "https://github.com/paradigmxzy/reth/issues/"
|
||||
)]
|
||||
#![warn(missing_debug_implementations, missing_docs, unreachable_pub, rustdoc::all)]
|
||||
#![deny(unused_must_use, rust_2018_idioms)]
|
||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||
|
||||
use igd::aio::search_gateway;
|
||||
use pin_project_lite::pin_project;
|
||||
use std::{
|
||||
@ -114,6 +110,16 @@ pub struct ResolveNatInterval {
|
||||
|
||||
// === impl ResolveNatInterval ===
|
||||
|
||||
impl fmt::Debug for ResolveNatInterval {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_struct("ResolveNatInterval")
|
||||
.field("resolver", &self.resolver)
|
||||
.field("future", &self.future.as_ref().map(drop))
|
||||
.field("interval", &self.interval)
|
||||
.finish()
|
||||
}
|
||||
}
|
||||
|
||||
impl ResolveNatInterval {
|
||||
fn with_interval(resolver: NatResolver, interval: tokio::time::Interval) -> Self {
|
||||
Self { resolver, future: None, interval }
|
||||
|
||||
Reference in New Issue
Block a user