Implement From<Located> for Range (#3377)

This commit is contained in:
Charlie Marsh 2023-03-08 13:50:20 -05:00 committed by GitHub
parent ff2c0dd491
commit 130e733023
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
232 changed files with 612 additions and 719 deletions

View file

@ -154,7 +154,7 @@ impl<'a> Visitor<'a> for ParenthesesNormalizer<'_> {
..
},
) {
let (source, start, end) = self.locator.slice(Range::from_located(value));
let (source, start, end) = self.locator.slice(Range::from(&*value));
// TODO(charlie): Encode this in the AST via separate node types.
if !is_radix_literal(&source[start..end]) {
value.parentheses = Parenthesize::Always;