mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-17 07:41:23 +01:00
enable format_push_string lint
This commit is contained in:
parent
5fd156a6bb
commit
bd6ea4e358
3 changed files with 22 additions and 12 deletions
|
|
@ -28,6 +28,7 @@ empty_structs_with_brackets = "warn"
|
|||
error_impl_error = "warn"
|
||||
filetype_is_file = "warn"
|
||||
float_cmp_const = "warn"
|
||||
format_push_string = "warn"
|
||||
get_unwrap = "warn"
|
||||
lossy_float_literal = "warn"
|
||||
mem_forget = "warn"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
use std::{
|
||||
collections::BTreeMap,
|
||||
fmt,
|
||||
fmt::Write,
|
||||
net::{IpAddr, Ipv4Addr},
|
||||
};
|
||||
|
||||
|
|
@ -191,7 +192,8 @@ impl fmt::Display for Config {
|
|||
let mut msg: String = "Active config values:\n\n".to_owned();
|
||||
|
||||
for line in lines.into_iter().enumerate() {
|
||||
msg += &format!("{}: {}\n", line.1 .0, line.1 .1);
|
||||
writeln!(msg, "{}: {}", line.1 .0, line.1 .1)
|
||||
.expect("write to in-memory buffer should succeed");
|
||||
}
|
||||
|
||||
write!(f, "{msg}")
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
use std::{
|
||||
collections::BTreeMap,
|
||||
convert::{TryFrom, TryInto},
|
||||
fmt::Write,
|
||||
sync::Arc,
|
||||
time::Instant,
|
||||
};
|
||||
|
|
@ -413,13 +414,13 @@ impl Service {
|
|||
|
||||
for (r, (e, i)) in map.iter() {
|
||||
let elapsed = i.elapsed();
|
||||
msg += &format!(
|
||||
"{} {}: {}m{}s\n",
|
||||
r,
|
||||
e,
|
||||
writeln!(
|
||||
msg,
|
||||
"{r} {e}: {}m{}s",
|
||||
elapsed.as_secs() / 60,
|
||||
elapsed.as_secs() % 60
|
||||
);
|
||||
)
|
||||
.expect("write to in-memory buffer should succeed");
|
||||
}
|
||||
RoomMessageEventContent::text_plain(&msg)
|
||||
}
|
||||
|
|
@ -718,8 +719,10 @@ impl Service {
|
|||
markdown_message.push_str("The following user ids are not valid:\n```\n");
|
||||
html_message.push_str("The following user ids are not valid:\n<pre>\n");
|
||||
for invalid_user in invalid_users {
|
||||
markdown_message.push_str(&format!("{invalid_user}\n"));
|
||||
html_message.push_str(&format!("{invalid_user}\n"));
|
||||
writeln!(markdown_message, "{invalid_user}")
|
||||
.expect("write to in-memory buffer should succeed");
|
||||
writeln!(html_message, "{invalid_user}")
|
||||
.expect("write to in-memory buffer should succeed");
|
||||
}
|
||||
markdown_message.push_str("```\n\n");
|
||||
html_message.push_str("</pre>\n\n");
|
||||
|
|
@ -730,8 +733,10 @@ impl Service {
|
|||
html_message
|
||||
.push_str("The following users are not from this server:\n<pre>\n");
|
||||
for remote_id in remote_ids {
|
||||
markdown_message.push_str(&format!("{remote_id}\n"));
|
||||
html_message.push_str(&format!("{remote_id}\n"));
|
||||
writeln!(markdown_message, "{remote_id}")
|
||||
.expect("write to in-memory buffer should succeed");
|
||||
writeln!(html_message, "{remote_id}")
|
||||
.expect("write to in-memory buffer should succeed");
|
||||
}
|
||||
markdown_message.push_str("```\n\n");
|
||||
html_message.push_str("</pre>\n\n");
|
||||
|
|
@ -740,8 +745,10 @@ impl Service {
|
|||
markdown_message.push_str("The following users do not exist:\n```\n");
|
||||
html_message.push_str("The following users do not exist:\n<pre>\n");
|
||||
for non_existant_id in non_existant_ids {
|
||||
markdown_message.push_str(&format!("{non_existant_id}\n"));
|
||||
html_message.push_str(&format!("{non_existant_id}\n"));
|
||||
writeln!(markdown_message, "{non_existant_id}")
|
||||
.expect("write to in-memory buffer should succeed");
|
||||
writeln!(html_message, "{non_existant_id}")
|
||||
.expect("write to in-memory buffer should succeed");
|
||||
}
|
||||
markdown_message.push_str("```\n\n");
|
||||
html_message.push_str("</pre>\n\n");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue