Clippy sweep: clean across the workspace
- Box the oversized enum variants (Event::AccountRegistered, gossip Msg::Entry) so small events aren't sized to a full Account; serde is transparent so the wire/log format is unchanged. - Use the configured server description in the SERVER line (it was hardcoded and the config field went unread). - Derive the ChanServ SET label from the ChanSetting (drops toggle's 8th arg); rename inspircd from_us -> sourced. - allow the two framework-idiom lints with rationale (tonic's Status in authorize; the guest-rename handler's inherent arg count). - Auto-fixed map_or/contains/split_once style lints.
This commit is contained in:
parent
790ec51b28
commit
2fd5676ff2
9 changed files with 71 additions and 44 deletions
|
|
@ -4,6 +4,9 @@ use fedserv_api::NetView;
|
|||
|
||||
// GHOST/RECOVER <nick> [password]: rename off a session using a nick you own,
|
||||
// either by being identified to its account or giving that account's password.
|
||||
// Every argument is a distinct input the guest-rename needs (the guest nick and
|
||||
// its sequence counter among them), so the count is inherent.
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub fn handle(me: &str, guest_nick: &str, guest_seq: &mut u32, from: &Sender, args: &[&str], ctx: &mut ServiceCtx, net: &dyn NetView, db: &dyn Store) {
|
||||
let Some(&target) = args.get(1) else {
|
||||
ctx.notice(me, from.uid, "Syntax: GHOST <nick> [password]");
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ pub fn handle(me: &str, from: &Sender, args: &[&str], ctx: &mut ServiceCtx, db:
|
|||
ctx.notice(me, from.uid, "You can't ungroup your main account name.");
|
||||
return;
|
||||
}
|
||||
if db.resolve_account(nick).map_or(true, |a| !a.eq_ignore_ascii_case(account)) {
|
||||
if db.resolve_account(nick).is_none_or(|a| !a.eq_ignore_ascii_case(account)) {
|
||||
ctx.notice(me, from.uid, format!("\x02{nick}\x02 isn't grouped to your account."));
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue