chore(v1.1.8): cargo fmt --all (reviewer)
8 files needed re-wrapping after the F2 clippy-fix pass landed un-fmt'd. Pure cosmetic — no behavioral change. Re-runs of `cargo fmt --all -- --check` now exit clean. Reviewer-supplied per REVIEW.md §7; folded onto the branch to avoid a NEEDS-CHANGES round-trip on a purely mechanical fix.
This commit is contained in:
@@ -328,7 +328,8 @@ fn bind_complete_password_reset(
|
||||
let svc = svc.clone();
|
||||
let cx = cx.clone();
|
||||
let user_opt = block_on(async move {
|
||||
svc.complete_password_reset(&cx, &token, &new_password).await
|
||||
svc.complete_password_reset(&cx, &token, &new_password)
|
||||
.await
|
||||
})?;
|
||||
Ok(user_opt.map_or(Dynamic::UNIT, |u| Dynamic::from(user_to_map(&u))))
|
||||
},
|
||||
@@ -390,7 +391,8 @@ fn bind_accept_invite(module: &mut Module, svc: &Arc<dyn UsersService>, cx: &Arc
|
||||
let svc = svc.clone();
|
||||
let cx = cx.clone();
|
||||
let accept_opt: Option<GeneratedAccept> = block_on(async move {
|
||||
svc.accept_invite(&cx, &token, &password, display_name).await
|
||||
svc.accept_invite(&cx, &token, &password, display_name)
|
||||
.await
|
||||
})?;
|
||||
Ok(accept_opt.map_or(Dynamic::UNIT, |a| Dynamic::from(a.session.token)))
|
||||
},
|
||||
@@ -471,21 +473,26 @@ fn user_to_map(user: &AppUser) -> Map {
|
||||
user.last_login_at
|
||||
.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()));
|
||||
let roles: Array = user
|
||||
.roles
|
||||
.iter()
|
||||
.cloned()
|
||||
.map(Dynamic::from)
|
||||
.collect();
|
||||
m.insert(
|
||||
"created_at".into(),
|
||||
Dynamic::from(user.created_at.to_rfc3339()),
|
||||
);
|
||||
m.insert(
|
||||
"updated_at".into(),
|
||||
Dynamic::from(user.updated_at.to_rfc3339()),
|
||||
);
|
||||
let roles: Array = user.roles.iter().cloned().map(Dynamic::from).collect();
|
||||
m.insert("roles".into(), roles.into());
|
||||
m
|
||||
}
|
||||
|
||||
fn list_page_to_map(page: &UsersListPage) -> Map {
|
||||
let mut m = Map::new();
|
||||
let items: Array = page.items.iter().map(|u| Dynamic::from(user_to_map(u))).collect();
|
||||
let items: Array = page
|
||||
.items
|
||||
.iter()
|
||||
.map(|u| Dynamic::from(user_to_map(u)))
|
||||
.collect();
|
||||
m.insert("users".into(), items.into());
|
||||
m.insert(
|
||||
"next_cursor".into(),
|
||||
|
||||
Reference in New Issue
Block a user