Skip to content

Commit

Permalink
fix(query): compare lowercase ids for --for
Browse files Browse the repository at this point in the history
  • Loading branch information
uncenter committed Jun 10, 2024
1 parent 658aac3 commit 4cc10f6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/ports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ pub fn query(command: Option<Query>, r#for: Option<String>, count: bool, get: Ke
serde_json::to_string_pretty(
data.ports
.into_iter()
.filter(|port| port.0 == r#for)
.filter(|port| port.0.to_lowercase() == r#for.to_lowercase())
.map(|port| get_key(port, get))
.collect::<Vec<_>>()
.first()
Expand Down
6 changes: 3 additions & 3 deletions src/userstyles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ pub fn query(
serde_json::to_string_pretty(
data.userstyles
.into_iter()
.filter(|port| port.0 == r#for)
.map(|port| get_userstyle_key(port, get))
.filter(|userstyle| userstyle.0.to_lowercase() == r#for.to_lowercase())
.map(|userstyle| get_userstyle_key(userstyle, get))
.collect::<Vec<_>>()
.first()
.ok_or_else(|| eyre!("no userstyle with the name '{}'", r#for))?
Expand All @@ -135,7 +135,7 @@ pub fn query(
&data
.userstyles
.into_iter()
.map(|port| get_userstyle_key(port, get))
.map(|userstyle| get_userstyle_key(userstyle, get))
.collect::<Vec<_>>(),
count,
)?;
Expand Down

0 comments on commit 4cc10f6

Please sign in to comment.