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

@ -7,7 +7,7 @@ use crate::types::Range;
/// Extract the leading indentation from a line.
pub fn indentation<'a, T>(locator: &'a Locator, located: &'a Located<T>) -> Option<&'a str> {
let range = Range::from_located(located);
let range = Range::from(located);
let indentation = locator.slice(Range::new(
Location::new(range.location.row(), 0),
Location::new(range.location.row(), range.location.column()),