From 8aa5d6729b2dfe87f5dbf9d62d8fd18f82c34c19 Mon Sep 17 00:00:00 2001 From: faumaray Date: Sat, 24 Oct 2026 15:01:01 +0300 Subject: [PATCH] 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 --- crates/voelin-ui-vm/src/chat/logic.rs | 29 +++++++++++++++------------ 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/crates/voelin-ui-vm/src/chat/logic.rs b/crates/voelin-ui-vm/src/chat/logic.rs index 4a8721d..f2f3d19 100644 --- a/crates/voelin-ui-vm/src/chat/logic.rs +++ b/crates/voelin-ui-vm/src/chat/logic.rs @@ -1138,19 +1138,22 @@ pub fn failure_text(request: &str, code: Option, message: &str) -> Op if request.starts_with("config_") || request.starts_with("perm_") { return Some(format!("{request}: {message}")); } - let done_by_user = matches!( - request, - "post" - | "pin" | "unpin" - | "react" | "unreact" - | "create_topic" - | "update_topic" - | "create_event" - | "update_event" - | "delete_event" - | "rsvp" - ); - if !done_by_user { + // The requests a user makes by hand (a list, not an or-pattern: the + // pattern's layout differs between rustfmt releases). + const DONE_BY_USER: [&str; 11] = [ + "post", + "pin", + "unpin", + "react", + "unreact", + "create_topic", + "update_topic", + "create_event", + "update_event", + "delete_event", + "rsvp", + ]; + if !DONE_BY_USER.contains(&request) { return None; } let text = match code {