mirror of
https://git.proxmox.com/git/proxmox
synced 2025-07-09 12:06:14 +00:00
some minor clippy lint cleanups
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
2aeeb83203
commit
ce859656ec
@ -10,7 +10,6 @@ use std::time::Instant;
|
||||
|
||||
use anyhow::*;
|
||||
use lazy_static::lazy_static;
|
||||
use libc;
|
||||
use nix::unistd::Pid;
|
||||
|
||||
use crate::tools::fs::file_read_firstline;
|
||||
|
@ -253,7 +253,7 @@ impl<'a> IntoIterator for &'a MountInfo {
|
||||
type IntoIter = Iter<'a>;
|
||||
|
||||
fn into_iter(self) -> Self::IntoIter {
|
||||
(&self.entries).into_iter()
|
||||
self.entries.iter()
|
||||
}
|
||||
}
|
||||
|
||||
@ -262,7 +262,7 @@ impl<'a> IntoIterator for &'a mut MountInfo {
|
||||
type IntoIter = IterMut<'a>;
|
||||
|
||||
fn into_iter(self) -> Self::IntoIter {
|
||||
(&mut self.entries).into_iter()
|
||||
self.entries.iter_mut()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -135,7 +135,7 @@ pub fn read_password(query: &str) -> Result<Vec<u8>, Error> {
|
||||
9 => asterisks = false, // tab disables echo
|
||||
0xA | 0xD => {
|
||||
// newline, we're done
|
||||
let _ignore_error = out.write_all("\r\n".as_bytes());
|
||||
let _ignore_error = out.write_all(b"\r\n");
|
||||
let _ignore_error = out.flush();
|
||||
break;
|
||||
}
|
||||
@ -144,7 +144,7 @@ pub fn read_password(query: &str) -> Result<Vec<u8>, Error> {
|
||||
if !password.is_empty() {
|
||||
password.pop();
|
||||
if asterisks {
|
||||
let _ignore_error = out.write_all("\x08 \x08".as_bytes());
|
||||
let _ignore_error = out.write_all(b"\x08 \x08");
|
||||
let _ignore_error = out.flush();
|
||||
}
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ impl AsHex<'_> {
|
||||
self.0.len() * 2
|
||||
}
|
||||
|
||||
pub fn to_string(self) -> String {
|
||||
pub fn to_hex_string(self) -> String {
|
||||
use std::fmt::Write;
|
||||
let mut s = String::with_capacity(self.display_len());
|
||||
write!(&mut s, "{}", self).expect("failed to format hex string");
|
||||
|
@ -73,8 +73,6 @@ pub mod date_time_as_rfc3339 {
|
||||
/// assert_eq!(obj, deserialized);
|
||||
/// ```
|
||||
pub mod bytes_as_base64 {
|
||||
|
||||
use base64;
|
||||
use serde::{Deserialize, Deserializer, Serializer};
|
||||
|
||||
pub fn serialize<S, T>(data: &T, serializer: S) -> Result<S::Ok, S::Error>
|
||||
|
@ -38,7 +38,7 @@ pub enum OpCode {
|
||||
impl OpCode {
|
||||
/// Tells whether it is a control frame or not
|
||||
pub fn is_control(self) -> bool {
|
||||
return self as u8 & 0b1000 > 0;
|
||||
(self as u8 & 0b1000) > 0
|
||||
}
|
||||
}
|
||||
|
||||
@ -187,7 +187,7 @@ impl<W: AsyncWrite + Unpin> WebSocketWriter<W> {
|
||||
/// and mark the frames as either 'Text' or 'Binary'
|
||||
pub fn new(mask: Option<[u8; 4]>, text: bool, writer: W) -> WebSocketWriter<W> {
|
||||
WebSocketWriter {
|
||||
writer: writer,
|
||||
writer,
|
||||
text,
|
||||
mask,
|
||||
frame: None,
|
||||
@ -265,7 +265,7 @@ pub struct FrameHeader {
|
||||
impl FrameHeader {
|
||||
/// Returns true if the frame is a control frame.
|
||||
pub fn is_control_frame(&self) -> bool {
|
||||
return self.frametype.is_control();
|
||||
self.frametype.is_control()
|
||||
}
|
||||
|
||||
/// Tries to parse a FrameHeader from bytes.
|
||||
|
Loading…
Reference in New Issue
Block a user