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

Does rust-imap parse things twice? #78

Closed
djahandarie opened this issue Jul 2, 2018 · 3 comments
Closed

Does rust-imap parse things twice? #78

djahandarie opened this issue Jul 2, 2018 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@djahandarie
Copy link

It seems like a common pattern in the codebase is to use run_command_and_read_response, and then parse its output. However, read_response already fully parses the response, its just that the results of the parsing seems to be discarded https://github.com/mattnenterprise/rust-imap/blob/master/src/client.rs#L521.

Assuming my reading of the code is correct, is there a reason it's laid out like this, as opposed to read_response returning a Vec of the parsed responses or similar?

@jonhoo
Copy link
Collaborator

jonhoo commented Jul 2, 2018

You are completely correct. This is an artifact of me wanting to make the changes as small as possible in #58 (which was already a pretty major change). That code could definitely be cleaned up significantly, and be made more efficient in the process.

I'm hoping that I'll have time at some point over the summer to do some deeper cleanup of rust-imap, including things like this, though if you want to give it a go, I'd be happy to review a PR! I'm also partially waiting on #69, without which I have relatively little power to plan and make new releases :)

@djahandarie
Copy link
Author

Understood! Thanks for the very quick response. If I run into serious performance issues I may take a shot at refactoring it, but that hasn't happened yet. :-)

@jonhoo jonhoo added enhancement New feature or request help wanted Extra attention is needed labels Nov 22, 2018
@jonhoo jonhoo added this to the imap 1.0 milestone Nov 22, 2018
@jonhoo
Copy link
Collaborator

jonhoo commented Nov 23, 2018

Let's move further discussion to jonhoo/rust-imap#78.

@jonhoo jonhoo closed this as completed Nov 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants