Skip to content
This repository has been archived by the owner on Sep 24, 2022. It is now read-only.

lookup() and lookup_mut() lifetime enhancements. #103

Merged

Conversation

MarkSwanson
Copy link

Rationale:

  • The path has nothing to do with the result.
  • The path has no need to live as long as the Value/self.
  • In some cases it can be hard to actually build a path that meets
    the same lifetime requirements as the Value or String slice result.

I submit to you that lifetime elision will not work with my use cases.
I really need the 'path' lifetime to be completely disassociated from the Value or String slice result.
I tried to provide an example in my original Issue. If my example was confusing or poorly worded please ask me to clean it up and I will happily do so.

Thank you.

Mark Swanson added 2 commits May 30, 2016 16:09
Rationale:

- The path has nothing to do with the result.
- The path has no need to live as long as the Value/self.
- In some cases it can be hard to actually build a path that meets
  the same lifetime requirements as the Value or String slice result.
@alexcrichton
Copy link
Collaborator

Thanks! You should actually be able to remove the lifetime annotations entirely as elision should cover this all now.

@MarkSwanson
Copy link
Author

Well, that would be fantastic! I thought elision only worked if all lifetimes were the same. I'll test this tonight.

@MarkSwanson
Copy link
Author

You're right (of course).
Thanks for teaching me about this.
The pull request now uses elision.

@alexcrichton alexcrichton merged commit 7363dbe into toml-rs:master Jun 1, 2016
@alexcrichton
Copy link
Collaborator

Thanks!

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

Successfully merging this pull request may close these issues.

None yet

2 participants