mirror of
https://github.com/astral-sh/ruff
synced 2026-01-11 00:24:13 -05:00
Implement Default for Location
This commit is contained in:
@@ -153,7 +153,7 @@ pub type LexResult = Result<Spanned, LexicalError>;
|
||||
|
||||
#[inline]
|
||||
pub fn make_tokenizer(source: &str) -> impl Iterator<Item = LexResult> + '_ {
|
||||
make_tokenizer_located(source, Location::new(1, 0))
|
||||
make_tokenizer_located(source, Location::default())
|
||||
}
|
||||
|
||||
pub fn make_tokenizer_located(
|
||||
|
||||
@@ -541,8 +541,8 @@ mod tests {
|
||||
source,
|
||||
StringKind::FString,
|
||||
false,
|
||||
Location::new(1, 0),
|
||||
Location::new(1, source.len() + 3), // 3 for prefix and quotes
|
||||
Location::default(),
|
||||
Location::default().with_col_offset(source.len() + 3), // 3 for prefix and quotes
|
||||
)
|
||||
.parse()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user