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

Method on ast::Value to get the range #27

Closed
kitsonk opened this issue Jul 29, 2022 · 4 comments
Closed

Method on ast::Value to get the range #27

kitsonk opened this issue Jul 29, 2022 · 4 comments

Comments

@kitsonk
Copy link
Contributor

kitsonk commented Jul 29, 2022

All of the variants of ast::Value contain a range: common::Range, but consumers currently have to pattern match all the variants to be able to extract the range, where a .range() methods could make that easy.

@dsherret
Copy link
Member

Should implement Range. Try importing that trait

impl<'a> Ranged for Value<'a> {

@kitsonk
Copy link
Contributor Author

kitsonk commented Jul 29, 2022

doh! 🤦

@dsherret
Copy link
Member

Yeah traits are annoying for discoverability if the language server lets you down lol

@kitsonk
Copy link
Contributor Author

kitsonk commented Jul 29, 2022

yeah, importing Ranged works like a charm.

@kitsonk kitsonk closed this as completed Jul 29, 2022
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 a pull request may close this issue.

2 participants