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

Improve lifetime of string reference returned by DepTriple::relation #17

Open
danieldk opened this issue May 29, 2019 · 0 comments
Open
Assignees

Comments

@danieldk
Copy link
Owner

The lifetime of the string reference returned by DepTriple::relation is bound to DepTriple. This is ok when DepTriple owns a String. However, if the string is borrowed, a more appropriate lifetime would be the actual lifetime of the string reference.

This makes the life easier for users of DepTriple, because now something like depgraph.head(idx).unwrap().relation() will complain that the relation outlives the triple.

@danieldk danieldk self-assigned this May 29, 2019
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

No branches or pull requests

1 participant