[ty] Implement the legacy PEP-484 convention for indicating positional-only parameters (#20248)
Co-authored-by: Carl Meyer <carl@astral.sh>
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
use ruff_python_ast::{HasNodeIndex, NodeIndex};
|
||||
|
||||
use crate::ast_node_ref::AstNodeRef;
|
||||
|
||||
/// Compact key for a node for use in a hash map.
|
||||
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash, get_size2::GetSize)]
|
||||
pub(super) struct NodeKey(NodeIndex);
|
||||
@@ -11,4 +13,8 @@ impl NodeKey {
|
||||
{
|
||||
NodeKey(node.node_index().load())
|
||||
}
|
||||
|
||||
pub(super) fn from_node_ref<T>(node_ref: &AstNodeRef<T>) -> Self {
|
||||
NodeKey(node_ref.index())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user