Skip to content

Commit

Permalink
make RustType fuzzy_matching right-inclusive
Browse files Browse the repository at this point in the history
  • Loading branch information
acovaci committed May 17, 2024
1 parent 9989cde commit 2ea846e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/types/rust_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ impl RustType {
pub fn is_supported(&self) -> bool {
SUPPORTED_TYPES
.iter()
.any(|&typ| (..RustType::from(typ)).contains(self))
.any(|&typ| (..=RustType::from(typ)).contains(self))
}

pub fn fuzzy_matches(&self, other: &Self) -> bool {
Expand Down Expand Up @@ -188,7 +188,7 @@ mod tests {
let end = RustType::from_string("::std::primitive::u8");
let value = RustType::from_string("std::primitive::u8");
assert!(end.fuzzy_matches(&start));
assert!(start.fuzzy_matches(&end));
assert!(!start.fuzzy_matches(&end));
assert!(value.fuzzy_matches(&start));
assert!(end.fuzzy_matches(&value));
}
Expand Down

0 comments on commit 2ea846e

Please sign in to comment.