Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd `or_filter` (this name is terrible we need a better one) #1389
Comments
sgrif
referenced this issue
Dec 13, 2017
Open
Yanked crates shouldn't be displayed on user/team pages #958
sgrif
closed this
in
#1460
Jan 14, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sgrif commentedDec 13, 2017
This method would basically behave the same as
filter, but if an existing where clause exists, it would combine withORrather thanAND. As an example use case, crates.io has a very large, complex, dynamically constructed query. However, regardless of whatever other conditions are added, they virtually always want to include a crate "if its name is an exact match for the search term". It would be very useful for that case to be able to put at the very end of the query construction, something like.or_filter(exact_match).I actually considered a method like this back in 0.1, but considered it to generally be a smell, since we already have
.oronExpressionMethods. However, I'm starting to think that it's reasonable to provide this, sincefilteris the only method in our query builder which concatenates rather than overrides, and it seems reasonable to allow concatenating withORrather thanAND.