Resolve new clippy complaints
This commit is contained in:
parent
552d684bdc
commit
a2be810dbc
|
@ -406,7 +406,7 @@ fn get_metrics_config() -> Result<MetricsConfig, String> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn query(q: &str) -> Result<String, String> {
|
pub fn query(q: &str) -> Result<String, String> {
|
||||||
let config = get_metrics_config().map_err(|err| err)?;
|
let config = get_metrics_config()?;
|
||||||
let query_url = format!(
|
let query_url = format!(
|
||||||
"{}/query?u={}&p={}&q={}",
|
"{}/query?u={}&p={}&q={}",
|
||||||
&config.host, &config.username, &config.password, &q
|
&config.host, &config.username, &config.password, &q
|
||||||
|
|
|
@ -64,10 +64,12 @@ async fn process_connection(
|
||||||
info!("connection from {:?}", peer_addr);
|
info!("connection from {:?}", peer_addr);
|
||||||
|
|
||||||
let mut data = vec![0u8; ip_echo_server_request_length()];
|
let mut data = vec![0u8; ip_echo_server_request_length()];
|
||||||
let (mut reader, mut writer) = socket.split();
|
|
||||||
|
|
||||||
let _ = timeout(IO_TIMEOUT, reader.read_exact(&mut data)).await??;
|
let mut writer = {
|
||||||
drop(reader);
|
let (mut reader, writer) = socket.split();
|
||||||
|
let _ = timeout(IO_TIMEOUT, reader.read_exact(&mut data)).await??;
|
||||||
|
writer
|
||||||
|
};
|
||||||
|
|
||||||
let request_header: String = data[0..HEADER_LENGTH].iter().map(|b| *b as char).collect();
|
let request_header: String = data[0..HEADER_LENGTH].iter().map(|b| *b as char).collect();
|
||||||
if request_header != "\0\0\0\0" {
|
if request_header != "\0\0\0\0" {
|
||||||
|
|
|
@ -137,10 +137,10 @@ macro_rules! impl_sysvar_get {
|
||||||
$syscall_name(var_addr)
|
$syscall_name(var_addr)
|
||||||
};
|
};
|
||||||
#[cfg(not(target_arch = "bpf"))]
|
#[cfg(not(target_arch = "bpf"))]
|
||||||
let result = crate::program_stubs::$syscall_name(var_addr);
|
let result = $crate::program_stubs::$syscall_name(var_addr);
|
||||||
|
|
||||||
match result {
|
match result {
|
||||||
crate::entrypoint::SUCCESS => Ok(var),
|
$crate::entrypoint::SUCCESS => Ok(var),
|
||||||
e => Err(e.into()),
|
e => Err(e.into()),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue