mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
chore: Fix nightly-only clippy lints
This commit is contained in:
@@ -27,5 +27,5 @@ fn init_user_agent() -> String { format!("{}/{}", name(), version()) }
|
||||
|
||||
fn init_version() -> String {
|
||||
conduwuit_build_metadata::version_tag()
|
||||
.map_or(SEMANTIC.to_owned(), |extra| format!("{SEMANTIC} ({extra})"))
|
||||
.map_or_else(|| SEMANTIC.to_owned(), |extra| format!("{SEMANTIC} ({extra})"))
|
||||
}
|
||||
|
||||
@@ -585,10 +585,11 @@ where
|
||||
(target_membership == MembershipState::Join).then_some(&power_levels.users_default)
|
||||
});
|
||||
|
||||
let mut join_rules = JoinRule::Invite;
|
||||
if let Some(jr) = &join_rules_event {
|
||||
join_rules = from_json_str::<RoomJoinRulesEventContent>(jr.content().get())?.join_rule;
|
||||
}
|
||||
let join_rules = if let Some(jr) = &join_rules_event {
|
||||
from_json_str::<RoomJoinRulesEventContent>(jr.content().get())?.join_rule
|
||||
} else {
|
||||
JoinRule::Invite
|
||||
};
|
||||
|
||||
let power_levels_event_id = power_levels_event.as_ref().map(Event::event_id);
|
||||
let sender_membership_event_id = sender_membership_event.as_ref().map(Event::event_id);
|
||||
|
||||
@@ -65,7 +65,7 @@ impl BoolExt for bool {
|
||||
fn into_option(self) -> Option<()> { self.then_some(()) }
|
||||
|
||||
#[inline]
|
||||
fn into_result(self) -> Result<(), ()> { self.ok_or(()) }
|
||||
fn into_result(self) -> Result<(), ()> { BoolExt::ok_or(self, ()) }
|
||||
|
||||
#[inline]
|
||||
fn map<T, F: FnOnce(Self) -> T>(self, f: F) -> T
|
||||
@@ -77,7 +77,7 @@ impl BoolExt for bool {
|
||||
|
||||
#[inline]
|
||||
fn map_ok_or<T, E, F: FnOnce() -> T>(self, err: E, f: F) -> Result<T, E> {
|
||||
self.ok_or(err).map(|()| f())
|
||||
BoolExt::ok_or(self, err).map(|()| f())
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
||||
Reference in New Issue
Block a user