Skip to content

Commit

Permalink
Fix panic in gamepad_viewer example when gamepad is connected (#15854)
Browse files Browse the repository at this point in the history
# 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
  • Loading branch information
rparrett authored Oct 11, 2024
1 parent 7f24c27 commit cdd71af
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/tools/gamepad_viewer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit cdd71af

Please sign in to comment.