Write the user's gateway requests as a list, not an or-pattern

rustfmt 1.94 (the pinned toolchain) and the nightly rustfmt lay out the long
or-pattern of failure_text differently, so voelin-ui-vm, clean on both when it
was merged, was not any more. A list of the eleven requests is laid out the
same by both; the requests and the answer are the same.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
faumarayandClaude Sonnet 5.5 committed 2026-10-24 15:01:01 +03:00
1 parent 84f4a4835f
commit 8aa5d6729b
1 file changed
+16 -13
+16 -13
View File
@@ -1138,19 +1138,22 @@ pub fn failure_text(request: &str, code: Option<ErrorCode>, message: &str) -> Op
if request.starts_with("config_") || request.starts_with("perm_") { if request.starts_with("config_") || request.starts_with("perm_") {
return Some(format!("{request}: {message}")); return Some(format!("{request}: {message}"));
} }
let done_by_user = matches!( // The requests a user makes by hand (a list, not an or-pattern: the
request, // pattern's layout differs between rustfmt releases).
"post" const DONE_BY_USER: [&str; 11] = [
| "pin" | "unpin" "post",
| "react" | "unreact" "pin",
| "create_topic" "unpin",
| "update_topic" "react",
| "create_event" "unreact",
| "update_event" "create_topic",
| "delete_event" "update_topic",
| "rsvp" "create_event",
); "update_event",
if !done_by_user { "delete_event",
"rsvp",
];
if !DONE_BY_USER.contains(&request) {
return None; return None;
} }
let text = match code { let text = match code {