mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-17 15:51:23 +01:00
enable string_slice lint
Also swaps out vendored HTML-escaping code for a dependency that I imagine has decent testing considering all of its reverse depedencies.
This commit is contained in:
parent
9abe4799db
commit
844b32f097
7 changed files with 35 additions and 73 deletions
|
|
@ -1,4 +1,4 @@
|
|||
use crate::{services, utils::HtmlEscape, Error, Result, Ruma};
|
||||
use crate::{services, Error, Result, Ruma};
|
||||
use ruma::{
|
||||
api::client::{error::ErrorKind, room::report_content},
|
||||
events::room::message,
|
||||
|
|
@ -61,7 +61,7 @@ pub(crate) async fn report_event_route(
|
|||
pdu.room_id,
|
||||
pdu.sender,
|
||||
body.score,
|
||||
HtmlEscape(body.reason.as_deref().unwrap_or(""))
|
||||
html_escape::encode_safe(body.reason.as_deref().unwrap_or(""))
|
||||
),
|
||||
));
|
||||
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ impl FedDest {
|
|||
fn port(&self) -> Option<u16> {
|
||||
match &self {
|
||||
Self::Literal(addr) => Some(addr.port()),
|
||||
Self::Named(_, port) => port[1..].parse().ok(),
|
||||
Self::Named(_, port) => port.strip_prefix(':').and_then(|x| x.parse().ok()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue