chore: satisfy clippy 1.95 (-D warnings) across the branch

- admin.rs: make the config/invite JSON response structs pub (they are
  returned from pub handlers; matches the already-pub AdminKeyView etc.)
- invite_codes/operator_settings: drop redundant reborrow (&mut *tx -> &mut tx)
- electrum: minimize a boolean (De Morgan, behavior-identical)
- relay: move the test module to end of file (items_after_test_module)

Pure lint hygiene surfaced by the current stable toolchain; no behavior
change. cargo clippy --all-targets -- -D warnings is now clean.
This commit is contained in:
jwinterm
2026-07-19 03:34:29 -04:00
parent 864724085c
commit 542e70b8e0
5 changed files with 29 additions and 29 deletions
+5 -5
View File
@@ -746,7 +746,7 @@ pub async fn admin_features(
// effective config for runtime-safe edits or flags restart-required.
#[derive(serde::Serialize)]
struct AdminConfigResponse {
pub struct AdminConfigResponse {
/// Effective value of every editable field (all populated).
effective: crate::config_overlay::SettingsOverlay,
/// DB overlay (operator-set values only): a field present here has source=db;
@@ -812,7 +812,7 @@ pub struct PutConfigRequest {
}
#[derive(serde::Serialize)]
struct PutConfigResponse {
pub struct PutConfigResponse {
/// "runtime" = hot-swapped, live now. "restart-required" = persisted, applies on
/// the next (graceful) restart.
applied: String,
@@ -954,7 +954,7 @@ pub struct MintInvitesRequest {
}
#[derive(serde::Serialize)]
struct MintInvitesResponse {
pub struct MintInvitesResponse {
/// RAW single-use codes — shown ONCE (only the hash is stored, unrecoverable).
codes: Vec<String>,
}
@@ -984,7 +984,7 @@ pub async fn admin_invites_mint(
}
#[derive(serde::Serialize)]
struct InviteView {
pub struct InviteView {
/// Non-secret: first 12 hex chars of the code hash (operator eyeball only).
code_prefix: String,
label: Option<String>,
@@ -994,7 +994,7 @@ struct InviteView {
}
#[derive(serde::Serialize)]
struct InvitesListResponse {
pub struct InvitesListResponse {
invites: Vec<InviteView>,
unused_count: i64,
}
+1 -1
View File
@@ -112,7 +112,7 @@ impl Database {
.await?;
codes.push(code);
}
self.append_admin_audit(&mut *tx, audit, secret).await?;
self.append_admin_audit(&mut tx, audit, secret).await?;
tx.commit().await?;
Ok(codes)
}
+1 -1
View File
@@ -148,7 +148,7 @@ impl Database {
.execute(&mut *tx)
.await?;
self.append_admin_audit(&mut *tx, audit, secret).await?;
self.append_admin_audit(&mut tx, audit, secret).await?;
tx.commit().await?;
Ok(version)
}
+1 -1
View File
@@ -489,7 +489,7 @@ impl ElectrumClient {
let use_primary = self
.primary
.as_ref()
.filter(|_| !(self.primary_in_cooldown(now) && !self.fallbacks.is_empty()));
.filter(|_| !self.primary_in_cooldown(now) || self.fallbacks.is_empty());
let mut last_err = AppError::NodeError("all Electrum servers failed".into());
+21 -21
View File
@@ -145,6 +145,27 @@ struct NostrRelayProvider {
write_allowlist: HashSet<String>,
}
impl RelayProvider for NostrRelayProvider {
fn kind(&self) -> &'static str {
self.kind
}
fn advertised_url(&self) -> &str {
&self.advertised_url
}
fn write_policy(&self) -> WritePolicy {
self.policy
}
fn inbound_pow_bits(&self) -> u8 {
self.inbound_pow_bits
}
fn max_event_bytes(&self) -> usize {
self.max_event_bytes
}
fn is_write_allowlisted(&self, author_hex: &str) -> bool {
!self.write_allowlist.is_empty() && self.write_allowlist.contains(author_hex)
}
}
#[cfg(test)]
mod tests {
use super::allowlist_entry_to_hex;
@@ -175,24 +196,3 @@ mod tests {
assert_eq!(allowlist_entry_to_hex("deadbeef"), None); // too short
}
}
impl RelayProvider for NostrRelayProvider {
fn kind(&self) -> &'static str {
self.kind
}
fn advertised_url(&self) -> &str {
&self.advertised_url
}
fn write_policy(&self) -> WritePolicy {
self.policy
}
fn inbound_pow_bits(&self) -> u8 {
self.inbound_pow_bits
}
fn max_event_bytes(&self) -> usize {
self.max_event_bytes
}
fn is_write_allowlisted(&self, author_hex: &str) -> bool {
!self.write_allowlist.is_empty() && self.write_allowlist.contains(author_hex)
}
}