mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-17 07:41:23 +01:00
enable string_add lint
This commit is contained in:
parent
cc5977b4e4
commit
9abe4799db
5 changed files with 14 additions and 13 deletions
|
|
@ -50,6 +50,7 @@ rest_pat_in_fully_bound_structs = "warn"
|
||||||
same_name_method = "warn"
|
same_name_method = "warn"
|
||||||
semicolon_inside_block = "warn"
|
semicolon_inside_block = "warn"
|
||||||
str_to_string = "warn"
|
str_to_string = "warn"
|
||||||
|
string_add = "warn"
|
||||||
string_lit_chars_any = "warn"
|
string_lit_chars_any = "warn"
|
||||||
string_to_string = "warn"
|
string_to_string = "warn"
|
||||||
suspicious_xor_used_as_pow = "warn"
|
suspicious_xor_used_as_pow = "warn"
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ where
|
||||||
};
|
};
|
||||||
|
|
||||||
parts.path_and_query = Some(
|
parts.path_and_query = Some(
|
||||||
(old_path_and_query + symbol + "access_token=" + hs_token)
|
format!("{old_path_and_query}{symbol}access_token={hs_token}")
|
||||||
.parse()
|
.parse()
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ pub(crate) async fn create_content_route(
|
||||||
mxc.clone(),
|
mxc.clone(),
|
||||||
body.filename
|
body.filename
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.map(|filename| "inline; filename=".to_owned() + filename)
|
.map(|filename| format!("inline; filename={filename}"))
|
||||||
.as_deref(),
|
.as_deref(),
|
||||||
body.content_type.as_deref(),
|
body.content_type.as_deref(),
|
||||||
&body.file,
|
&body.file,
|
||||||
|
|
|
||||||
|
|
@ -1598,15 +1598,15 @@ pub(crate) async fn sync_events_v4_route(
|
||||||
let name = match &*heroes {
|
let name = match &*heroes {
|
||||||
[] => None,
|
[] => None,
|
||||||
[only] => Some(only.0.clone()),
|
[only] => Some(only.0.clone()),
|
||||||
[firsts @ .., last] => Some(
|
[firsts @ .., last] => Some({
|
||||||
firsts
|
let firsts = firsts
|
||||||
.iter()
|
.iter()
|
||||||
.map(|h| h.0.clone())
|
.map(|h| h.0.clone())
|
||||||
.collect::<Vec<_>>()
|
.collect::<Vec<_>>()
|
||||||
.join(", ")
|
.join(", ");
|
||||||
+ " and "
|
|
||||||
+ &last.0,
|
format!("{firsts} and {}", last.0)
|
||||||
),
|
}),
|
||||||
};
|
};
|
||||||
|
|
||||||
let avatar = if let [only] = &*heroes {
|
let avatar = if let [only] = &*heroes {
|
||||||
|
|
|
||||||
|
|
@ -385,17 +385,17 @@ impl Service {
|
||||||
let output = format!(
|
let output = format!(
|
||||||
"Rooms:\n{}",
|
"Rooms:\n{}",
|
||||||
room_ids
|
room_ids
|
||||||
.filter_map(|r| r.ok())
|
.filter_map(std::result::Result::ok)
|
||||||
.map(|id| id.to_string()
|
.map(|id| format!(
|
||||||
+ "\tMembers: "
|
"{id}\tMembers: {}",
|
||||||
+ &services()
|
&services()
|
||||||
.rooms
|
.rooms
|
||||||
.state_cache
|
.state_cache
|
||||||
.room_joined_count(&id)
|
.room_joined_count(&id)
|
||||||
.ok()
|
.ok()
|
||||||
.flatten()
|
.flatten()
|
||||||
.unwrap_or(0)
|
.unwrap_or(0)
|
||||||
.to_string())
|
))
|
||||||
.collect::<Vec<_>>()
|
.collect::<Vec<_>>()
|
||||||
.join("\n")
|
.join("\n")
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue