From cdd71afde5218d403f507ae13c7182a161586bd0 Mon Sep 17 00:00:00 2001 From: Rob Parrett Date: Fri, 11 Oct 2024 09:40:21 -0700 Subject: [PATCH] Fix panic in `gamepad_viewer` example when gamepad is connected (#15854) # Objective Fixes #15832 ## Solution It seems that this was just a transliteration mistake during #15591. Update the correct text span index. ## Testing I tested on macos with: `cargo run --example gamepad_viewer` - without gamepad connected - with gamepad connected - disconnecting and reconnecting gamepad while running --- examples/tools/gamepad_viewer.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/tools/gamepad_viewer.rs b/examples/tools/gamepad_viewer.rs index d0add15810eef..9915d3a2e73f7 100644 --- a/examples/tools/gamepad_viewer.rs +++ b/examples/tools/gamepad_viewer.rs @@ -465,7 +465,7 @@ fn update_connected( .collect::>() .join("\n"); - *writer.text(query.single(), 2) = if !formatted.is_empty() { + *writer.text(query.single(), 1) = if !formatted.is_empty() { formatted } else { "None".to_string()