mirror of
https://github.com/RGBCube/cstree
synced 2025-07-27 09:07:44 +00:00
Update clippy and rustfmt to new nightly (#16)
This commit is contained in:
parent
f6905735eb
commit
e411243366
2 changed files with 4 additions and 6 deletions
|
@ -9,7 +9,7 @@ wrap_comments = true
|
|||
format_code_in_doc_comments = true
|
||||
format_macro_matchers = true
|
||||
|
||||
merge_imports = true
|
||||
imports_granularity= "Crate"
|
||||
|
||||
reorder_impl_items = true
|
||||
|
||||
|
|
|
@ -158,15 +158,13 @@ impl<L: Language, D, R> SyntaxNode<L, D, R> {
|
|||
// safety: protected by the write lock
|
||||
let slot = unsafe { &mut *data.children.get_unchecked(i).get() };
|
||||
let mut child_data = None;
|
||||
if let Some(child) = slot {
|
||||
if let Some(NodeOrToken::Node(node)) = slot {
|
||||
// Tokens have no children that point to them, so if there are no external pointers
|
||||
// and the pointer from the parent is dropped they will be dropped.
|
||||
// Nodes may be pointed to by their children, hence we check them first.
|
||||
if let NodeOrToken::Node(node) = child {
|
||||
node.drop_recursive();
|
||||
child_data = Some(node.data);
|
||||
}
|
||||
}
|
||||
// if the above `if let` was true, this drops `child`
|
||||
*slot = None;
|
||||
if let Some(data) = child_data {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue