Skip to content

Commit

Permalink
rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
vcfxb committed Dec 23, 2021
1 parent 0436b9d commit 0cbd5dc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/api/rcos/meetings/creation/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ impl CreationContext {
send_query::<Self>(creation_context::Variables {
host: host.map(|h| vec![h]).unwrap_or(vec![]),
today: Utc::today().naive_utc(),
include_semesters
include_semesters,
})
.await
}
Expand Down
7 changes: 5 additions & 2 deletions src/web/services/user/profile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,13 +247,16 @@ async fn save_changes(

// Check that the current user role can switch to the submitted role.
// First get the json version of the role as a string.
let role_json: String = json!(role).as_str().expect("Role serialized to JSON string").to_string();
let role_json: String = json!(role)
.as_str()
.expect("Role serialized to JSON string")
.to_string();
// Then index into the available roles on the context with the selected role to check availability.
if form.template["roles"][&role_json] != json!(true) {
return Err(TelescopeError::BadRequest {
header: "Invalid Role Selection".into(),
message: "The selected role is not available at this time".into(),
show_status_code: false
show_status_code: false,
});
}

Expand Down

0 comments on commit 0cbd5dc

Please sign in to comment.