mirror of
https://github.com/pezkuwichain/pezkuwi-telemetry.git
synced 2026-05-31 14:01:06 +00:00
Appease Clippy
This commit is contained in:
+9
-8
@@ -20,10 +20,10 @@ use node::connector::NodeConnector;
|
||||
use types::NodeId;
|
||||
use util::{Locator, LocatorFactory};
|
||||
|
||||
const VERSION: &'static str = env!("CARGO_PKG_VERSION");
|
||||
const AUTHORS: &'static str = env!("CARGO_PKG_AUTHORS");
|
||||
const NAME: &'static str = "Substrate Telemetry Backend";
|
||||
const ABOUT: &'static str = "This is the Telemetry Backend that injects and provide the data sent by Substrate/Polkadot nodes";
|
||||
const VERSION: &str = env!("CARGO_PKG_VERSION");
|
||||
const AUTHORS: &str = env!("CARGO_PKG_AUTHORS");
|
||||
const NAME: &str = "Substrate Telemetry Backend";
|
||||
const ABOUT: &str = "This is the Telemetry Backend that injects and provide the data sent by Substrate/Polkadot nodes";
|
||||
|
||||
#[derive(Clap)]
|
||||
#[clap(name = NAME, version = VERSION, author = AUTHORS, about = ABOUT)]
|
||||
@@ -54,9 +54,9 @@ enum LogLevel {
|
||||
Trace,
|
||||
}
|
||||
|
||||
impl Into<log::LevelFilter> for &LogLevel {
|
||||
fn into(self) -> log::LevelFilter {
|
||||
match self {
|
||||
impl From<&LogLevel> for log::LevelFilter {
|
||||
fn from(log_level: &LogLevel) -> Self {
|
||||
match log_level {
|
||||
LogLevel::Error => log::LevelFilter::Error,
|
||||
LogLevel::Warn => log::LevelFilter::Warn,
|
||||
LogLevel::Info => log::LevelFilter::Info,
|
||||
@@ -65,6 +65,7 @@ impl Into<log::LevelFilter> for &LogLevel {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Entry point for connecting nodes
|
||||
#[get("/submit/")]
|
||||
async fn node_route(
|
||||
@@ -74,7 +75,7 @@ async fn node_route(
|
||||
locator: web::Data<Addr<Locator>>,
|
||||
) -> Result<HttpResponse, Error> {
|
||||
let ip = req.connection_info().realip_remote_addr().and_then(|mut addr| {
|
||||
if let Some(port_idx) = addr.find(":") {
|
||||
if let Some(port_idx) = addr.find(':') {
|
||||
addr = &addr[..port_idx];
|
||||
}
|
||||
addr.parse::<Ipv4Addr>().ok()
|
||||
|
||||
Reference in New Issue
Block a user