Skip to content

RFC 5256 - SORT command #180

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

Merged
merged 19 commits into from
Apr 20, 2021
Merged

RFC 5256 - SORT command #180

merged 19 commits into from
Apr 20, 2021

Conversation

soywod
Copy link
Contributor

@soywod soywod commented Mar 12, 2021

#178


This change is Reviewable

@codecov
Copy link

codecov bot commented Mar 16, 2021

Codecov Report

Merging #180 (5e0eed1) into master (400e80a) will increase coverage by 1.40%.
The diff coverage is 96.89%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #180      +/-   ##
==========================================
+ Coverage   76.35%   77.75%   +1.40%     
==========================================
  Files          14       15       +1     
  Lines        1607     1722     +115     
==========================================
+ Hits         1227     1339     +112     
- Misses        380      383       +3     
Impacted Files Coverage Δ
src/client.rs 84.95% <89.18%> (+0.20%) ⬆️
src/extensions/sort.rs 100.00% <100.00%> (ø)
src/parse.rs 87.68% <100.00%> (+0.44%) ⬆️
tests/imap_integration.rs 100.00% <100.00%> (ø)
src/types/unsolicited_response.rs 34.28% <0.00%> (+2.85%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 400e80a...5e0eed1. Read the comment docs.

@jonhoo
Copy link
Owner

jonhoo commented Mar 27, 2021

I really like the new direction of the parsing, thank you!

@soywod
Copy link
Contributor Author

soywod commented Apr 11, 2021

Sorry, I was quite busy these days. I try to update my PR this week!

@soywod
Copy link
Contributor Author

soywod commented Apr 15, 2021

I updated my proposal. I opted for a single enum SortCriterion. The Reverse variant takes a ref to another criterion to avoid infinite recursion (I guess a Box could also do the trick?). The sort fn (as well as the uid_sort) takes now a slice of criterion. I also improved the charset parameter: I set up an enum called SortCharset.

I discovered sth while implementing this feature. The IMAP protocol accepts nested REVERSE. BUT it does not affect the order!

  • SUBJECT sorts by subjects
  • REVERSE SUBJECT reverse sorts by subjects
  • REVERSE REVERSE SUBJECT also reverse sorts by subjects!
  • In fact, REVERSE(1..n) SUBJECT will always reverse sort by subjects

I am still new at Rust, I may have implemented sth wrongly. Please correct me if needed 😉, I'm open to discussion!

Copy link
Owner

@jonhoo jonhoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the way you're going with this 👍 And yes, I think & is fine for SortCriterion.

I've left a bunch of mostly minor comments in there that should hopefully not be too onerous to fix!

@jonhoo
Copy link
Owner

jonhoo commented Apr 18, 2021

We're getting really close!

Copy link
Owner

@jonhoo jonhoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is in great shape now, thanks for sticking with it! One minor change which I think I can commit myself through the GitHub interface, and then I'll land it!

@jonhoo jonhoo merged commit 2898e19 into jonhoo:master Apr 20, 2021
@jonhoo
Copy link
Owner

jonhoo commented Apr 20, 2021

Wohoo, it's in! 🎉
We're getting closer and closer to that 3.0.0 milestone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants