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

Minor clean-up #45

Merged
merged 2 commits into from
Nov 7, 2019
Merged

Minor clean-up #45

merged 2 commits into from
Nov 7, 2019

Conversation

memoryruins
Copy link
Contributor

@memoryruins memoryruins commented Nov 7, 2019

This PR utilizes std's impls for text_input and makes use of mem::take in the todo example.

@memoryruins
Copy link
Contributor Author

Ah the life of only having nightly installed on this desktop has gotten the best of me; mem::take stabilizes in 1.40 🤦. In that case, we can use std::mem::replace(&mut self.text_input, String::default()) or I can revert that commit altogether.

Copy link
Member

@hecrj hecrj left a comment

Choose a reason for hiding this comment

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

Thank you! These are nice changes! ❤️

I take note of from_iter and to_vec ✍️

examples/todos.rs Outdated Show resolved Hide resolved
@hecrj hecrj added the improvement An internal improvement label Nov 7, 2019
@hecrj hecrj added this to the 0.1.0 milestone Nov 7, 2019
Copy link
Member

@hecrj hecrj left a comment

Choose a reason for hiding this comment

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

Awesome. Thank you! 🎉


string
use std::iter::FromIterator;
String::from_iter(self.0.iter())
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note to anyone looking in from the changelog: this could have been self.0.iter().collect() :)
micro-refactoring intensifies

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

Successfully merging this pull request may close these issues.

2 participants