MCPcopy Create free account
hub / github.com/astral-sh/ruff / stmt_function_def_fields

Function stmt_function_def_fields

crates/ruff_python_ast/src/comparable.rs:1647–1668  ·  view source on GitHub ↗
(node: &ast::StmtFunctionDef)

Source from the content-addressed store, hash-verified

1645}
1646
1647fn stmt_function_def_fields(node: &ast::StmtFunctionDef) -> StmtFunctionDefFields<'_> {
1648 let ast::StmtFunctionDef {
1649 is_async,
1650 name,
1651 parameters,
1652 body,
1653 decorator_list,
1654 returns,
1655 type_params,
1656 range: _,
1657 node_index: _,
1658 } = node;
1659 StmtFunctionDefFields {
1660 is_async: *is_async,
1661 name: name.as_str(),
1662 parameters: ComparableParameters(parameters),
1663 body: ComparableSlice::new(body),
1664 decorator_list: ComparableSlice::new(decorator_list),
1665 returns: returns.as_ref().map(Into::into),
1666 type_params: type_params.as_deref().map(Into::into),
1667 }
1668}
1669
1670#[derive(Debug, PartialEq, Eq, Hash)]
1671struct StmtClassDefFields<'a> {

Callers

nothing calls this directly

Calls 4

as_strMethod · 0.45
mapMethod · 0.45
as_refMethod · 0.45

Tested by

no test coverage detected