chore(v1.1.8): clippy --all-targets clean (F2)
Sweep the v1.1.8-introduced clippy warnings under
--workspace --all-targets --all-features -- -D warnings:
* 12x map_unwrap_or in executor-core/sdk/users.rs — rewrite as
map_or; mostly the Option<X> -> Dynamic conversion shape.
* Doc-list-without-indentation in
app_user_password_reset_repo.rs's module docstring — rewrap
so a continuation line doesn't start with `+ `.
* usize-as-i64 cast in app_user_repo.rs list — use
i64::try_from(...).unwrap_or(i64::MAX) for the cursor cap.
* 2x map_unwrap_or in users_service.rs env helpers — map_or.
* single-pattern match in users_service.rs login — let-else
rewrite so the dummy-Argon2 side-effect stays in the
diverging branch (no semantic change).
Also updated the 10 executor-core integration-test bins
(sdk_email, sdk_kv, sdk_docs, sdk_files, sdk_pubsub,
sdk_secrets, sdk_http, sdk_subscriber_token,
module_redaction_logging, modules) to pass the new
NoopUsersService positional arg into Services::new().
NOTE — the brief specifies running this attestation under `cargo
clean` first. I skipped the clean step because an earlier
`cargo test --workspace` froze this host (the user explicitly
asked me to keep subsequent builds lighter). The incremental
cache was hot for every workspace crate when clippy ran; test
binaries appeared in the Checking output as expected. Flagged in
HANDBACK §6 F2 + §7.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -117,9 +117,7 @@ fn bind_get(module: &mut Module, svc: &Arc<dyn UsersService>, cx: &Arc<SdkCallCx
|
||||
let svc = svc.clone();
|
||||
let cx = cx.clone();
|
||||
let user_opt = block_on(async move { svc.get(&cx, id).await })?;
|
||||
Ok(user_opt
|
||||
.map(|u| Dynamic::from(user_to_map(&u)))
|
||||
.unwrap_or(Dynamic::UNIT))
|
||||
Ok(user_opt.map_or(Dynamic::UNIT, |u| Dynamic::from(user_to_map(&u))))
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -134,9 +132,7 @@ fn bind_find_by_email(module: &mut Module, svc: &Arc<dyn UsersService>, cx: &Arc
|
||||
let svc = svc.clone();
|
||||
let cx = cx.clone();
|
||||
let user_opt = block_on(async move { svc.find_by_email(&cx, &email).await })?;
|
||||
Ok(user_opt
|
||||
.map(|u| Dynamic::from(user_to_map(&u)))
|
||||
.unwrap_or(Dynamic::UNIT))
|
||||
Ok(user_opt.map_or(Dynamic::UNIT, |u| Dynamic::from(user_to_map(&u))))
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -226,9 +222,7 @@ fn bind_login(module: &mut Module, svc: &Arc<dyn UsersService>, cx: &Arc<SdkCall
|
||||
let cx = cx.clone();
|
||||
let session_opt: Option<GeneratedSession> =
|
||||
block_on(async move { svc.login(&cx, &email, &password).await })?;
|
||||
Ok(session_opt
|
||||
.map(|s| Dynamic::from(s.token))
|
||||
.unwrap_or(Dynamic::UNIT))
|
||||
Ok(session_opt.map_or(Dynamic::UNIT, |s| Dynamic::from(s.token)))
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -243,9 +237,7 @@ fn bind_verify(module: &mut Module, svc: &Arc<dyn UsersService>, cx: &Arc<SdkCal
|
||||
let svc = svc.clone();
|
||||
let cx = cx.clone();
|
||||
let user_opt = block_on(async move { svc.verify(&cx, &token).await })?;
|
||||
Ok(user_opt
|
||||
.map(|u| Dynamic::from(user_to_map(&u)))
|
||||
.unwrap_or(Dynamic::UNIT))
|
||||
Ok(user_opt.map_or(Dynamic::UNIT, |u| Dynamic::from(user_to_map(&u))))
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -297,9 +289,7 @@ fn bind_verify_email(module: &mut Module, svc: &Arc<dyn UsersService>, cx: &Arc<
|
||||
let svc = svc.clone();
|
||||
let cx = cx.clone();
|
||||
let user_opt = block_on(async move { svc.verify_email(&cx, &token).await })?;
|
||||
Ok(user_opt
|
||||
.map(|u| Dynamic::from(user_to_map(&u)))
|
||||
.unwrap_or(Dynamic::UNIT))
|
||||
Ok(user_opt.map_or(Dynamic::UNIT, |u| Dynamic::from(user_to_map(&u))))
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -340,9 +330,7 @@ fn bind_complete_password_reset(
|
||||
let user_opt = block_on(async move {
|
||||
svc.complete_password_reset(&cx, &token, &new_password).await
|
||||
})?;
|
||||
Ok(user_opt
|
||||
.map(|u| Dynamic::from(user_to_map(&u)))
|
||||
.unwrap_or(Dynamic::UNIT))
|
||||
Ok(user_opt.map_or(Dynamic::UNIT, |u| Dynamic::from(user_to_map(&u))))
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -379,9 +367,7 @@ fn bind_accept_invite(module: &mut Module, svc: &Arc<dyn UsersService>, cx: &Arc
|
||||
let cx = cx.clone();
|
||||
let accept_opt: Option<GeneratedAccept> =
|
||||
block_on(async move { svc.accept_invite(&cx, &token, &password, None).await })?;
|
||||
Ok(accept_opt
|
||||
.map(|a| Dynamic::from(a.session.token))
|
||||
.unwrap_or(Dynamic::UNIT))
|
||||
Ok(accept_opt.map_or(Dynamic::UNIT, |a| Dynamic::from(a.session.token)))
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -406,9 +392,7 @@ fn bind_accept_invite(module: &mut Module, svc: &Arc<dyn UsersService>, cx: &Arc
|
||||
let accept_opt: Option<GeneratedAccept> = block_on(async move {
|
||||
svc.accept_invite(&cx, &token, &password, display_name).await
|
||||
})?;
|
||||
Ok(accept_opt
|
||||
.map(|a| Dynamic::from(a.session.token))
|
||||
.unwrap_or(Dynamic::UNIT))
|
||||
Ok(accept_opt.map_or(Dynamic::UNIT, |a| Dynamic::from(a.session.token)))
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -475,20 +459,17 @@ fn user_to_map(user: &AppUser) -> Map {
|
||||
"display_name".into(),
|
||||
user.display_name
|
||||
.clone()
|
||||
.map(Dynamic::from)
|
||||
.unwrap_or(Dynamic::UNIT),
|
||||
.map_or(Dynamic::UNIT, Dynamic::from),
|
||||
);
|
||||
m.insert(
|
||||
"email_verified_at".into(),
|
||||
user.email_verified_at
|
||||
.map(|d| Dynamic::from(d.to_rfc3339()))
|
||||
.unwrap_or(Dynamic::UNIT),
|
||||
.map_or(Dynamic::UNIT, |d| Dynamic::from(d.to_rfc3339())),
|
||||
);
|
||||
m.insert(
|
||||
"last_login_at".into(),
|
||||
user.last_login_at
|
||||
.map(|d| Dynamic::from(d.to_rfc3339()))
|
||||
.unwrap_or(Dynamic::UNIT),
|
||||
.map_or(Dynamic::UNIT, |d| Dynamic::from(d.to_rfc3339())),
|
||||
);
|
||||
m.insert("created_at".into(), Dynamic::from(user.created_at.to_rfc3339()));
|
||||
m.insert("updated_at".into(), Dynamic::from(user.updated_at.to_rfc3339()));
|
||||
@@ -509,8 +490,7 @@ fn list_page_to_map(page: &UsersListPage) -> Map {
|
||||
m.insert(
|
||||
"next_cursor".into(),
|
||||
page.next_cursor
|
||||
.map(|d| Dynamic::from(d.to_rfc3339()))
|
||||
.unwrap_or(Dynamic::UNIT),
|
||||
.map_or(Dynamic::UNIT, |d| Dynamic::from(d.to_rfc3339())),
|
||||
);
|
||||
m
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user