diff --git a/otg/core/src/types.rs b/otg/core/src/types.rs index 7a4e5ad..09a0a0f 100644 --- a/otg/core/src/types.rs +++ b/otg/core/src/types.rs @@ -354,7 +354,7 @@ impl Tree { width } - pub fn bfs_iter<'a>(&'a self) -> BFSIter { + pub fn bfs_iter(&self) -> BFSIter { let mut queue = VecDeque::new(); queue.push_back(&self.nodes[0]); BFSIter { tree: self, queue } @@ -363,7 +363,7 @@ impl Tree { impl<'a> From<&'a GameNode> for Tree { fn from(root: &'a GameNode) -> Self { - fn add_subtree<'a>(tree: &mut Tree, parent_idx: usize, node: &'a GameNode) { + fn add_subtree(tree: &mut Tree, parent_idx: usize, node: &GameNode) { let idx = tree.add_node(parent_idx, node.id()); let children = match node { @@ -401,7 +401,7 @@ impl<'a, T> Iterator for BFSIter<'a, T> { fn next(&mut self) -> Option { let retval = self.queue.pop_front(); - if let Some(ref retval) = retval { + if let Some(retval) = retval { retval .children .iter() diff --git a/otg/gtk/src/components/review_tree.rs b/otg/gtk/src/components/review_tree.rs index 28acbe2..f759a34 100644 --- a/otg/gtk/src/components/review_tree.rs +++ b/otg/gtk/src/components/review_tree.rs @@ -18,7 +18,7 @@ use cairo::Context; use glib::Object; use gtk::{prelude::*, subclass::prelude::*}; use otg_core::Tree; -use sgf::{GameNode, GameRecord}; +use sgf::GameRecord; use std::{cell::RefCell, rc::Rc}; use uuid::Uuid; diff --git a/sgf/src/game.rs b/sgf/src/game.rs index d11b677..4c68c60 100644 --- a/sgf/src/game.rs +++ b/sgf/src/game.rs @@ -121,7 +121,7 @@ impl GameRecord { pub fn mainline(&self) -> Vec<&GameNode> { let mut moves: Vec<&GameNode> = vec![]; - let mut next = self.children.get(0); + let mut next = self.children.first(); while let Some(node) = next { // Given that I know that I have a node, and I know that I'm going to push a reference // to it onto my final list, I want to get the first of its children. And I want to @@ -136,8 +136,8 @@ impl GameRecord { moves.push(node); next = match node { - GameNode::MoveNode(node) => node.children.get(0), - GameNode::SetupNode(node) => node.children.get(0), + GameNode::MoveNode(node) => node.children.first(), + GameNode::SetupNode(node) => node.children.first(), }; }