From 7ff92b1cf5d019a0d6482eeb2438de38c1d5972e Mon Sep 17 00:00:00 2001 From: Thierry Berger Date: Mon, 5 Aug 2024 11:32:43 +0200 Subject: Fix CI (#707) Removes dead code + other rust 1.80 related fixes --- src/data/graph.rs | 97 ---------------------- .../joint/multibody_joint/multibody_joint_set.rs | 3 +- src/geometry/interaction_graph.rs | 2 +- 3 files changed, 3 insertions(+), 99 deletions(-) diff --git a/src/data/graph.rs b/src/data/graph.rs index 6c701e4..8f38dae 100644 --- a/src/data/graph.rs +++ b/src/data/graph.rs @@ -517,74 +517,6 @@ impl Graph { } } -/// An iterator over either the nodes without edges to them or from them. -pub struct Externals<'a, N: 'a> { - iter: std::iter::Enumerate>>, - dir: Direction, -} - -impl<'a, N: 'a> Iterator for Externals<'a, N> { - type Item = NodeIndex; - fn next(&mut self) -> Option { - let k = self.dir as usize; - loop { - match self.iter.next() { - None => return None, - Some((index, node)) => { - if node.next[k] == EdgeIndex::end() && node.next[1 - k] == EdgeIndex::end() { - return Some(NodeIndex::new(index as u32)); - } else { - continue; - } - } - } - } - } -} - -/// Iterator over the neighbors of a node. -/// -/// Iterator element type is `NodeIndex`. -/// -/// Created with [`.neighbors()`][1], [`.neighbors_directed()`][2] or -/// [`.neighbors_undirected()`][3]. -/// -/// [1]: struct.Graph.html#method.neighbors -/// [2]: struct.Graph.html#method.neighbors_directed -/// [3]: struct.Graph.html#method.neighbors_undirected -pub struct Neighbors<'a, E: 'a> { - /// starting node to skip over - skip_start: NodeIndex, - edges: &'a [Edge], - next: [EdgeIndex; 2], -} - -impl<'a, E> Iterator for Neighbors<'a, E> { - type Item = NodeIndex; - - fn next(&mut self) -> Option { - // First any outgoing edges - match self.edges.get(self.next[0].index()) { - None => {} - Some(edge) => { - self.next[0] = edge.next[0]; - return Some(edge.node[1]); - } - } - // Then incoming edges - // For an "undirected" iterator (traverse both incoming - // and outgoing edge lists), make sure we don't double - // count selfloops by skipping them in the incoming list. - while let Some(edge) = self.edges.get(self.next[1].index()) { - self.next[1] = edge.next[1]; - if edge.node[0] != self.skip_start { - return Some(edge.node[0]); - } - } - None - } -} - struct EdgesWalkerMut<'a, E: 'a> { edges: &'a mut [Edge], next: EdgeIndex, @@ -783,32 +715,3 @@ where self.index == rhs.index && self.weight == rhs.weight } } - -/// Iterator over all nodes of a graph. -pub struct NodeReferences<'a, N: 'a> { - iter: std::iter::Enumerate>>, -} - -impl<'a, N> Iterator for NodeReferences<'a, N> { - type Item = (NodeIndex, &'a N); - - fn next(&mut self) -> Option { - self.iter - .next() - .map(|(i, node)| (NodeIndex::new(i as u32), &node.weight)) - } - - fn size_hint(&self) -> (usize, Option) { - self.iter.size_hint() - } -} - -impl<'a, N> DoubleEndedIterator for NodeReferences<'a, N> { - fn next_back(&mut self) -> Option { - self.iter - .next_back() - .map(|(i, node)| (NodeIndex::new(i as u32), &node.weight)) - } -} - -impl<'a, N> ExactSizeIterator for NodeReferences<'a, N> {} diff --git a/src/dynamics/joint/multibody_joint/multibody_joint_set.rs b/src/dynamics/joint/multibody_joint/multibody_joint_set.rs index 694e2ff..8a56a72 100644 --- a/src/dynamics/joint/multibody_joint/multibody_joint_set.rs +++ b/src/dynamics/joint/multibody_joint/multibody_joint_set.rs @@ -55,12 +55,13 @@ impl IndexedData for MultibodyJointHandle { #[derive(Copy, Clone, Debug, PartialEq, Eq)] /// Indexes usable to get a multibody link from a `MultibodyJointSet`. /// -/// ```.skip +/// ```ignore /// // With: /// // multibody_joint_set: MultibodyJointSet /// // multibody_link_id: MultibodyLinkId /// let multibody = &multibody_joint_set[multibody_link_id.multibody]; /// let link = multibody.link(multibody_link_id.id).expect("Link not found."); +/// ``` pub struct MultibodyLinkId { pub(crate) graph_id: RigidBodyGraphIndex, /// The multibody index to be used as `&multibody_joint_set[multibody]` to diff --git a/src/geometry/interaction_graph.rs b/src/geometry/interaction_graph.rs index 4d037d1..de2948b 100644 --- a/src/geometry/interaction_graph.rs +++ b/src/geometry/interaction_graph.rs @@ -66,7 +66,7 @@ impl InteractionGraph { /// a map between `CollisionObjectSlabHandle` and `ColliderGraphIndex`, then you should update this /// map to associate `id` to the handle returned by this method. For example: /// - /// ```.ignore + /// ```ignore /// // Let `id` be the graph index of the collision object we want to remove. /// if let Some(other_handle) = graph.remove_node(id) { /// // The graph index of `other_handle` changed to `id` due to the removal. -- cgit