mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 10:49:50 +00:00
Add convenience helper methods for AST nodes representing function parameters (#15871)
This commit is contained in:
parent
bcdb3f9840
commit
d9a1034db0
36 changed files with 150 additions and 238 deletions
|
@ -798,7 +798,7 @@ fn handle_parameter_comment<'a>(
|
|||
parameter: &'a Parameter,
|
||||
source: &str,
|
||||
) -> CommentPlacement<'a> {
|
||||
if parameter.annotation.as_deref().is_some() {
|
||||
if parameter.annotation().is_some() {
|
||||
let colon = first_non_trivia_token(parameter.name.end(), source).expect(
|
||||
"A annotated parameter should have a colon following its name when it is valid syntax.",
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue