mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-27 12:29:28 +00:00
Implement From<Located>
for Range
(#3377)
This commit is contained in:
parent
ff2c0dd491
commit
130e733023
232 changed files with 612 additions and 719 deletions
|
@ -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()),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue