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
This commit is contained in:
Rob Parrett 2024-10-11 09:40:21 -07:00 committed by GitHub
parent 7f24c27645
commit cdd71afde5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -465,7 +465,7 @@ fn update_connected(
.collect::<Vec<_>>()
.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()