Skip to content

Commit 2e3b2f8

Browse files
authored
Merge pull request #51 from etnt/either-contains
Function either_contains renamed to either_equals_to
2 parents 7032223 + 4233d71 commit 2e3b2f8

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
### Improved
55

6+
- Fixed `CollisionPair::either_contains` to use `.contains` instead of `==`, contributed by [@etnt](https://github.com/etnt) in [#51](https://github.com/CleanCut/rusty_engine/pull/51)
7+
- Added `CollisionPair::either_equals_to` which uses `==`, contributed by [@etnt](https://github.com/etnt) in [#51](https://github.com/CleanCut/rusty_engine/pull/51)
68
- Fixed documentation for a few fields of the `Engine` struct which were in the wrong place.
79

810
## [5.0.6] - 2022-05-19

src/physics.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ pub struct CollisionPair(pub String, pub String);
6363
impl CollisionPair {
6464
/// Whether either of the labels contains the text.
6565
pub fn either_contains<T: Into<String>>(&self, text: T) -> bool {
66+
let text = text.into();
67+
self.0.contains(&text) || self.1.contains(&text)
68+
}
69+
/// Whether either of the labels equals to the text.
70+
pub fn either_equals_to<T: Into<String>>(&self, text: T) -> bool {
6671
let text = text.into();
6772
(self.0 == text) || (self.1 == text)
6873
}

0 commit comments

Comments
 (0)