mirror of
git://git.proxmox.com/git/proxmox-backup.git
synced 2025-02-03 13:47:18 +03:00
more stable clippy fixups
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
75ecc27907
commit
5574114a2a
@ -384,8 +384,9 @@ impl<R: BufRead> NetworkParser<R> {
|
|||||||
if mask.is_some() {
|
if mask.is_some() {
|
||||||
// address already has a mask - ignore netmask
|
// address already has a mask - ignore netmask
|
||||||
} else {
|
} else {
|
||||||
|
use std::fmt::Write as _;
|
||||||
check_netmask(netmask, is_v6)?;
|
check_netmask(netmask, is_v6)?;
|
||||||
cidr.push_str(&format!("/{}", netmask));
|
let _ = write!(cidr, "/{}", netmask);
|
||||||
}
|
}
|
||||||
if is_v6 {
|
if is_v6 {
|
||||||
set_cidr_v6(interface, cidr)?;
|
set_cidr_v6(interface, cidr)?;
|
||||||
|
@ -637,12 +637,9 @@ pub struct TaskListInfo {
|
|||||||
fn render_task_line(info: &TaskListInfo) -> String {
|
fn render_task_line(info: &TaskListInfo) -> String {
|
||||||
let mut raw = String::new();
|
let mut raw = String::new();
|
||||||
if let Some(status) = &info.state {
|
if let Some(status) = &info.state {
|
||||||
raw.push_str(&format!(
|
use std::fmt::Write as _;
|
||||||
"{} {:08X} {}\n",
|
|
||||||
info.upid_str,
|
let _ = writeln!(raw, "{} {:08X} {}", info.upid_str, status.endtime(), status);
|
||||||
status.endtime(),
|
|
||||||
status
|
|
||||||
));
|
|
||||||
} else {
|
} else {
|
||||||
raw.push_str(&info.upid_str);
|
raw.push_str(&info.upid_str);
|
||||||
raw.push('\n');
|
raw.push('\n');
|
||||||
|
@ -174,12 +174,13 @@ pub fn update_dns(
|
|||||||
|
|
||||||
let mut data = String::new();
|
let mut data = String::new();
|
||||||
|
|
||||||
|
use std::fmt::Write as _;
|
||||||
if let Some(search) = config["search"].as_str() {
|
if let Some(search) = config["search"].as_str() {
|
||||||
data.push_str(&format!("search {}\n", search));
|
let _ = writeln!(data, "search {}", search);
|
||||||
}
|
}
|
||||||
for opt in &["dns1", "dns2", "dns3"] {
|
for opt in &["dns1", "dns2", "dns3"] {
|
||||||
if let Some(server) = config[opt].as_str() {
|
if let Some(server) = config[opt].as_str() {
|
||||||
data.push_str(&format!("nameserver {}\n", server));
|
let _ = writeln!(data, "nameserver {}", server);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if let Some(options) = config["options"].as_str() {
|
if let Some(options) = config["options"].as_str() {
|
||||||
|
@ -476,21 +476,24 @@ pub fn send_load_media_email(
|
|||||||
to: &str,
|
to: &str,
|
||||||
reason: Option<String>,
|
reason: Option<String>,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
|
use std::fmt::Write as _;
|
||||||
|
|
||||||
let subject = format!("Load Media '{}' request for drive '{}'", label_text, drive);
|
let subject = format!("Load Media '{}' request for drive '{}'", label_text, drive);
|
||||||
|
|
||||||
let mut text = String::new();
|
let mut text = String::new();
|
||||||
|
|
||||||
if let Some(reason) = reason {
|
if let Some(reason) = reason {
|
||||||
text.push_str(&format!(
|
let _ = write!(
|
||||||
|
text,
|
||||||
"The drive has the wrong or no tape inserted. Error:\n{}\n\n",
|
"The drive has the wrong or no tape inserted. Error:\n{}\n\n",
|
||||||
reason
|
reason
|
||||||
));
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
text.push_str("Please insert the requested media into the backup drive.\n\n");
|
text.push_str("Please insert the requested media into the backup drive.\n\n");
|
||||||
|
|
||||||
text.push_str(&format!("Drive: {}\n", drive));
|
let _ = writeln!(text, "Drive: {}", drive);
|
||||||
text.push_str(&format!("Media: {}\n", label_text));
|
let _ = writeln!(text, "Media: {}", label_text);
|
||||||
|
|
||||||
send_job_status_mail(to, &subject, &text)
|
send_job_status_mail(to, &subject, &text)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user