mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-12 09:31:20 +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,7 +31,7 @@ use std::task::{Context, Poll};
|
||||
|
||||
const METRICS_CONTENT_TYPE: &str = "application/openmetrics-text;charset=utf-8;version=1.0.0";
|
||||
|
||||
pub async fn metrics_server(registry: Registry) -> Result<(), std::io::Error> {
|
||||
pub(crate) async fn metrics_server(registry: Registry) -> Result<(), std::io::Error> {
|
||||
// Serve on localhost.
|
||||
let addr = ([127, 0, 0, 1], 0).into();
|
||||
|
||||
@ -47,7 +47,7 @@ pub async fn metrics_server(registry: Registry) -> Result<(), std::io::Error> {
|
||||
})
|
||||
}
|
||||
|
||||
pub struct MetricService {
|
||||
pub(crate) struct MetricService {
|
||||
reg: Arc<Mutex<Registry>>,
|
||||
}
|
||||
|
||||
@ -102,12 +102,12 @@ impl Service<Request<Body>> for MetricService {
|
||||
}
|
||||
}
|
||||
|
||||
pub struct MakeMetricService {
|
||||
pub(crate) struct MakeMetricService {
|
||||
reg: SharedRegistry,
|
||||
}
|
||||
|
||||
impl MakeMetricService {
|
||||
pub fn new(registry: Registry) -> MakeMetricService {
|
||||
pub(crate) fn new(registry: Registry) -> MakeMetricService {
|
||||
MakeMetricService {
|
||||
reg: Arc::new(Mutex::new(registry)),
|
||||
}
|
||||
|
Reference in New Issue
Block a user