Skip to content

Commit

Permalink
make --query case insensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjones2014 committed Nov 28, 2021
1 parent a712775 commit fe48b9d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "caniuse-rs"
description = "A command line client for caniuse.com, written in Rust."
version = "0.2.0"
version = "0.2.1"
edition = "2021"
license = "MIT"
homepage = "https://github.com/mrjones2014/caniuse-rs"
Expand Down
3 changes: 2 additions & 1 deletion src/alfred_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@ pub fn get_json(
query: &str,
pretty: &bool,
) -> Result<String, serde_json::Error> {
let lowercase_query = query.to_lowercase();
let alfred_items = AlfredItemList {
items: features
.iter()
.filter(|feature| {
let match_str = feature.string_for_matching().to_lowercase();
match_str.contains(&query) || query.contains(&match_str)
match_str.contains(&lowercase_query) || lowercase_query.contains(&match_str)
})
.map(|feature| AlfredItem::from(feature.to_owned()))
.collect(),
Expand Down

0 comments on commit fe48b9d

Please sign in to comment.