mirror of
https://github.com/astral-sh/ruff
synced 2026-01-20 21:10:48 -05:00
Implement Ranged on more structs (#6639)
## Summary I noticed some inconsistencies around uses of `.range.start()`, structs that have a `TextRange` field but don't implement `Ranged`, etc. ## Test Plan `cargo test`
This commit is contained in:
@@ -318,9 +318,8 @@ impl<'a> StringParser<'a> {
|
||||
)
|
||||
})?;
|
||||
let leading =
|
||||
&expression[..usize::from(value.range().start() - start_location) - 1];
|
||||
let trailing =
|
||||
&expression[usize::from(value.range().end() - start_location) - 1..];
|
||||
&expression[..usize::from(value.start() - start_location) - 1];
|
||||
let trailing = &expression[usize::from(value.end() - start_location) - 1..];
|
||||
vec![Expr::from(ast::ExprFormattedValue {
|
||||
value: Box::new(value),
|
||||
debug_text: Some(ast::DebugText {
|
||||
|
||||
Reference in New Issue
Block a user