1
Fork 0
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:
DQ 2021-02-16 23:39:35 +01:00 committed by GitHub
parent f6905735eb
commit e411243366
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 6 deletions

View file

@ -9,7 +9,7 @@ wrap_comments = true
format_code_in_doc_comments = true format_code_in_doc_comments = true
format_macro_matchers = true format_macro_matchers = true
merge_imports = true imports_granularity= "Crate"
reorder_impl_items = true reorder_impl_items = true

View file

@ -158,14 +158,12 @@ impl<L: Language, D, R> SyntaxNode<L, D, R> {
// safety: protected by the write lock // safety: protected by the write lock
let slot = unsafe { &mut *data.children.get_unchecked(i).get() }; let slot = unsafe { &mut *data.children.get_unchecked(i).get() };
let mut child_data = None; 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 // 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. // 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. // Nodes may be pointed to by their children, hence we check them first.
if let NodeOrToken::Node(node) = child { node.drop_recursive();
node.drop_recursive(); child_data = Some(node.data);
child_data = Some(node.data);
}
} }
// if the above `if let` was true, this drops `child` // if the above `if let` was true, this drops `child`
*slot = None; *slot = None;