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
|
|
@ -42,6 +42,9 @@ const SUBSCRIBER_BUFFER: usize = 1024;
|
|||
// Every RPC (both services) needs `authorization: Bearer <token>` matching the
|
||||
// configured secret. Constant-time compare — same posture as password/secret
|
||||
// checks elsewhere in this codebase, cheap insurance against a timing side-channel.
|
||||
// Status is tonic's error type, used by every RPC — boxing it here would fight
|
||||
// the framework's convention for marginal size gain.
|
||||
#[allow(clippy::result_large_err)]
|
||||
fn authorize<T>(req: &Request<T>, token: &str) -> Result<(), Status> {
|
||||
let got = req
|
||||
.metadata()
|
||||
|
|
@ -409,7 +412,7 @@ mod tests {
|
|||
vhost: None,
|
||||
vhost_request: None,
|
||||
};
|
||||
let registered = LogEntry::for_test("A", 0, 1, Event::AccountRegistered(acct));
|
||||
let registered = LogEntry::for_test("A", 0, 1, Event::AccountRegistered(Box::new(acct)));
|
||||
let wire = to_wire(®istered).expect("account registration replicates");
|
||||
match wire.kind {
|
||||
Some(Kind::AccountRegistered(a)) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue