Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make body field optional #137

Merged
merged 1 commit into from Oct 22, 2020
Merged

Make body field optional #137

merged 1 commit into from Oct 22, 2020

Conversation

@felipe-fg
Copy link
Contributor

@felipe-fg felipe-fg commented Oct 22, 2020

Post body now is an optional field.

I have changed the test because there is a case mismatch when transforming words before adding to filter.

Resolves #117.

.map(str::to_lowercase)
.filter(|word| !stopwords.contains(word))
.collect::<HashSet<String>>(),
content.map(|content| {

This comment has been minimized.

@mre

mre Oct 22, 2020
Collaborator

Nice pattern! I didn't know that Option.map() would leave the None case untouched.

This comment has been minimized.

@felipe-fg

felipe-fg Oct 22, 2020
Author Contributor

Yeah, it's pretty nice to use Option on things like this. (Same for Result)

@mre
Copy link
Collaborator

@mre mre commented Oct 22, 2020

Looks great. Thanks for the PR!

@mre mre merged commit 05f3979 into tinysearch:master Oct 22, 2020
3 checks passed
3 checks passed
build (stable) build (stable)
Details
build (beta) build (beta)
Details
build (nightly) build (nightly)
Details
mre added a commit that referenced this pull request Oct 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants
You can’t perform that action at this time.