mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-01 22:31:47 +00:00
![]() ## Summary This PR updates the logic for parsing type annotation to accept a `ExprStringLiteral` node instead of the string value and the range. The main motivation of this change is to simplify the implementation of `parse_type_annotation` function with: * Use the `opener_len` and `closer_len` from the string flags to get the raw contents range instead of extracting it via * `str::leading_quote(expression).unwrap().text_len()` * `str::trailing_quote(expression).unwrap().text_len()` * Avoid comparing the string content if we already know that it's implicitly concatenated ## Test Plan `cargo insta test` |
||
---|---|---|
.. | ||
resources | ||
src | ||
__init__.py | ||
Cargo.toml |