mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-28 21:05:08 +00:00
Replace row/column based Location
with byte-offsets. (#3931)
This commit is contained in:
parent
ee91598835
commit
cab65b25da
418 changed files with 6203 additions and 7040 deletions
|
@ -1,4 +1,4 @@
|
|||
use rustpython_parser::ast::Location;
|
||||
use ruff_text_size::TextSize;
|
||||
#[cfg(feature = "serde")]
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
|
@ -27,9 +27,9 @@ impl Fix {
|
|||
self.edits.is_empty()
|
||||
}
|
||||
|
||||
/// Return the [`Location`] of the first [`Edit`] in the [`Fix`].
|
||||
pub fn min_location(&self) -> Option<Location> {
|
||||
self.edits.iter().map(Edit::location).min()
|
||||
/// Return the [`TextSize`] of the first [`Edit`] in the [`Fix`].
|
||||
pub fn min_start(&self) -> Option<TextSize> {
|
||||
self.edits.iter().map(Edit::start).min()
|
||||
}
|
||||
|
||||
/// Return a slice of the [`Edit`] elements in the [`Fix`].
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue