mirror of
https://github.com/tree-sitter/tree-sitter.git
synced 2026-09-10 07:36:22 -04:00
docs(rust): update doc comment on node ids
This commit is contained in:
parent
f279d10aa2
commit
c053b63be8
|
|
@ -1493,10 +1493,14 @@ impl<'tree> Node<'tree> {
|
|||
|
||||
/// Get a numeric id for this node that is unique.
|
||||
///
|
||||
/// Within a given syntax tree, no two nodes have the same id. However, if
|
||||
/// a new tree is created based on an older tree, and a node from the old
|
||||
/// tree is reused in the process, then that node will have the same id in
|
||||
/// both trees.
|
||||
/// Within a given syntax tree, no two nodes have the same id. However:
|
||||
///
|
||||
/// - If a new tree is created based on an older tree, and a node from the old tree is reused in
|
||||
/// the process, then that node will have the same id in both trees.
|
||||
///
|
||||
/// - A node not marked as having changes does not guarantee it was reused.
|
||||
///
|
||||
/// - If a node is marked as having changed in the old tree, it will not be reused.
|
||||
#[must_use]
|
||||
pub fn id(&self) -> usize {
|
||||
self.0.id as usize
|
||||
|
|
|
|||
Loading…
Reference in a new issue