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

Implement Deref<Target=str> for Key #1370

Merged
merged 1 commit into from
Jul 4, 2020

Conversation

faulesocke
Copy link
Contributor

Description

Fixes #1369

Checklist:

  • I have run ./ci/run_stable_checks.sh
  • I have reviewed my own code
  • I have added tests

@faulesocke
Copy link
Contributor Author

I guess tests are not necessary.

impl Deref for Key {
type Target = str;

#[inline]
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the advantage of inlining this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Don't know what I was thinking, but at least it's also in std::Strings impl marked as inline. Should I remove it?

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess explicitly inlining this might make LLVM do some more optimization work, but I don't think it really matters.

@teymour-aldridge
Copy link
Contributor

IMO it would be nice (but not essential) to have a test for this.

@jstarry jstarry merged commit 34b4f6c into yewstack:master Jul 4, 2020
@jstarry
Copy link
Member

jstarry commented Jul 4, 2020

Looks good to me! I agree that tests aren't essential and the inline is fine

jstarry pushed a commit that referenced this pull request Aug 16, 2020
Co-authored-by: Urs Schulz <github@ursschulz.de>
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.

Impl Deref<Target = str> for yew::virtual_dom::Key
3 participants