ソースを参照

make clippy happy

Evan Almloff 2 年 前
コミット
64db1def9f
1 ファイル変更2 行追加7 行削除
  1. 2 7
      packages/native-core/src/tree.rs

+ 2 - 7
packages/native-core/src/tree.rs

@@ -1,10 +1,5 @@
-use core::panic;
-use parking_lot::lock_api::RawMutex as _;
-use parking_lot::{RawMutex, RwLock};
-use std::cell::UnsafeCell;
 use std::collections::VecDeque;
 use std::collections::VecDeque;
 use std::marker::PhantomData;
 use std::marker::PhantomData;
-use std::sync::Arc;
 
 
 #[derive(Hash, PartialEq, Eq, Clone, Copy, Debug, PartialOrd, Ord)]
 #[derive(Hash, PartialEq, Eq, Clone, Copy, Debug, PartialOrd, Ord)]
 pub struct NodeId(pub usize);
 pub struct NodeId(pub usize);
@@ -313,10 +308,10 @@ impl<T> TreeView<T> for Tree<T> {
             println!("parent_child_mut: {:?}\n{:?}", id, children_ids);
             println!("parent_child_mut: {:?}\n{:?}", id, children_ids);
             debug_assert!(!children_ids.iter().any(|child_id| *child_id == id));
             debug_assert!(!children_ids.iter().any(|child_id| *child_id == id));
             let mut borrowed = unsafe {
             let mut borrowed = unsafe {
+                let as_vec = children_ids.to_vec();
                 self.nodes
                 self.nodes
                     .get_many_mut_unchecked(
                     .get_many_mut_unchecked(
-                        children_ids
-                            .to_vec()
+                        as_vec
                             .into_iter()
                             .into_iter()
                             .rev()
                             .rev()
                             .map(|id| id.0)
                             .map(|id| id.0)