remove single-use lifetimes

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
strawberry 2024-03-02 17:26:37 -05:00 committed by June
parent 56f36fe7a7
commit a9f714ae8d
5 changed files with 6 additions and 7 deletions

View file

@ -285,7 +285,7 @@ lossy_float_literal = "warn"
mem_forget = "warn" mem_forget = "warn"
# missing_assert_message = "warn" # missing_assert_message = "warn"
# mod_module_files = "warn" # mod_module_files = "warn"
multiple_inherent_impl = "warn" # multiple_inherent_impl = "warn"
mutex_atomic = "warn" mutex_atomic = "warn"
# same_name_method = "warn" # same_name_method = "warn"
# semicolon_outside_block = "warn" # semicolon_outside_block = "warn"

View file

@ -281,7 +281,7 @@ impl service::rooms::state_cache::Data for KeyValueDatabase {
} }
#[tracing::instrument(skip(self))] #[tracing::instrument(skip(self))]
fn server_in_room<'a>(&'a self, server: &ServerName, room_id: &RoomId) -> Result<bool> { fn server_in_room(&self, server: &ServerName, room_id: &RoomId) -> Result<bool> {
let mut key = server.as_bytes().to_vec(); let mut key = server.as_bytes().to_vec();
key.push(0xff); key.push(0xff);
key.extend_from_slice(room_id.as_bytes()); key.extend_from_slice(room_id.as_bytes());

View file

@ -1066,6 +1066,7 @@ impl KeyValueDatabase {
res res
} }
#[allow(clippy::infinite_loop)]
#[tracing::instrument] #[tracing::instrument]
pub fn start_check_for_updates_task() { pub fn start_check_for_updates_task() {
tokio::spawn(async move { tokio::spawn(async move {

View file

@ -262,7 +262,7 @@ impl Service {
} }
#[tracing::instrument(skip(self))] #[tracing::instrument(skip(self))]
pub fn server_in_room<'a>(&'a self, server: &ServerName, room_id: &RoomId) -> Result<bool> { pub fn server_in_room(&self, server: &ServerName, room_id: &RoomId) -> Result<bool> {
self.db.server_in_room(server, room_id) self.db.server_in_room(server, room_id)
} }

View file

@ -138,9 +138,7 @@ pub(crate) fn deserialize_from_str<
deserializer: D, deserializer: D,
) -> Result<T, D::Error> { ) -> Result<T, D::Error> {
struct Visitor<T: FromStr<Err = E>, E>(std::marker::PhantomData<T>); struct Visitor<T: FromStr<Err = E>, E>(std::marker::PhantomData<T>);
impl<'de, T: FromStr<Err = Err>, Err: std::fmt::Display> serde::de::Visitor<'de> impl<T: FromStr<Err = Err>, Err: std::fmt::Display> serde::de::Visitor<'_> for Visitor<T, Err> {
for Visitor<T, Err>
{
type Value = T; type Value = T;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "a parsable string") write!(formatter, "a parsable string")
@ -162,7 +160,7 @@ pub(crate) fn deserialize_from_str<
/// string when passed to a format string. /// string when passed to a format string.
pub(crate) struct HtmlEscape<'a>(pub(crate) &'a str); pub(crate) struct HtmlEscape<'a>(pub(crate) &'a str);
impl<'a> fmt::Display for HtmlEscape<'a> { impl fmt::Display for HtmlEscape<'_> {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
// Because the internet is always right, turns out there's not that many // Because the internet is always right, turns out there's not that many
// characters to escape: http://stackoverflow.com/questions/7381974 // characters to escape: http://stackoverflow.com/questions/7381974