Skip to content

Commit 702f8ff

Browse files
authored
Merge #711: Change HatState::Leftdown into HatState::LeftDown
* Fix HatState::Leftdown casing into HatState::LeftDown * Fixed example * Added an entry to the changelog
2 parents e2e84a8 + 8e88e75 commit 702f8ff

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

changelog.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ when upgrading from a version of rust-sdl2 to another.
33

44
### v0.31
55

6+
[PR #711](https://github.com/Rust-SDL2/rust-sdl2/pull/711)
7+
8+
* **Breaking change** Change HatState::Leftdown casing into HatState::LeftDown to be consistent with naming.
9+
610
[PR #673](https://github.com/Rust-sdl2/rust-sdl2/pull/673)
711

812
* Support Audio Capture in AudioCallbacks.
@@ -11,7 +15,7 @@ when upgrading from a version of rust-sdl2 to another.
1115

1216
* **Breaking change** Make get\_swap\_interval return an enum instead of i32
1317
* The signature of set\_swap\_interval has been changed as well, but it shouldn't
14-
breaking exisitng code too much.
18+
breaking existing code too much.
1519

1620
[PR #683](https://github.com/Rust-sdl2/rust-sdl2/pull/684)
1721

src/sdl2/joystick.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ pub enum HatState {
376376
RightUp = 0x02 | 0x01,
377377
RightDown = 0x02 | 0x04,
378378
LeftUp = 0x08 | 0x01,
379-
Leftdown = 0x08 | 0x04,
379+
LeftDown = 0x08 | 0x04,
380380
}
381381

382382
impl HatState {
@@ -390,7 +390,7 @@ impl HatState {
390390
3 => HatState::RightUp,
391391
6 => HatState::RightDown,
392392
9 => HatState::LeftUp,
393-
12 => HatState::Leftdown,
393+
12 => HatState::LeftDown,
394394
_ => panic!("Unexpected hat position: {}", raw),
395395
}
396396
}
@@ -405,7 +405,7 @@ impl HatState {
405405
HatState::RightUp => 3,
406406
HatState::RightDown => 6,
407407
HatState::LeftUp => 9,
408-
HatState::Leftdown => 12,
408+
HatState::LeftDown => 12,
409409
}
410410

411411
}

0 commit comments

Comments
 (0)