Skip to content

Commit 28ce649

Browse files
committed
Removed unused imports
1 parent ae3e292 commit 28ce649

File tree

5 files changed

+3
-21
lines changed

5 files changed

+3
-21
lines changed

src/graph.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ use core::fmt::Debug;
1515
#[cfg(not(feature = "no_std"))]
1616
use std::fmt::Debug;
1717

18-
#[cfg(feature = "no_std")]
19-
use core::mem;
20-
2118
#[cfg(feature = "no_std")]
2219
extern crate alloc;
2320
#[cfg(feature = "no_std")]
@@ -89,8 +86,6 @@ pub struct Graph<T> {
8986
edge_labels: HashMap<Edge, String>,
9087
}
9188

92-
const DEFAULT_LABEL: &str = "";
93-
9489
impl<T> Graph<T> {
9590
/// Creates a new graph.
9691
///

src/iterators/bfs.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ impl<'a, T> Iterator for Bfs<'a, T> {
5656

5757
fn next(&mut self) -> Option<Self::Item> {
5858
loop {
59-
let mut next_ptr = None;
60-
6159
if let Some(current_ptr) = &self.current_ptr {
6260
// Yield current pointed value if
6361
// it isn't in the visited stack.
@@ -80,23 +78,19 @@ impl<'a, T> Iterator for Bfs<'a, T> {
8078
// Move to next root if possible and yield it.
8179
if self.queue.is_empty() {
8280
if let Some(next_root) = self.roots_stack.pop() {
83-
next_ptr = Some(next_root);
81+
self.current_ptr = Some(next_root);
8482
} else {
8583
// Break execution if there are no more roots
8684
return None;
8785
}
8886
} else {
8987
// Pop item from queue and set it
9088
// as the current pointer.
91-
next_ptr = self.queue.pop_front();
89+
self.current_ptr = self.queue.pop_front();
9290
}
9391
} else {
9492
return None;
9593
}
96-
97-
if next_ptr.is_some() {
98-
self.current_ptr = next_ptr;
99-
}
10094
}
10195
}
10296
}

src/iterators/owning_iterator.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@
22

33
use crate::vertex_id::VertexId;
44

5-
#[cfg(feature = "no_std")]
6-
extern crate alloc;
7-
8-
#[cfg(feature = "no_std")]
9-
use alloc::boxed::Box;
10-
115
#[cfg(not(feature = "no_std"))]
126
use std::fmt::Debug;
137

src/iterators/topo.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ impl<'a, T> Topo<'a, T> {
7272
}
7373
None => {
7474
if check_cyclic && self.vertices.len() != self.iterable.vertex_count() {
75-
panic!(PANIC_MSG);
75+
panic!("{}", PANIC_MSG);
7676
}
7777
None
7878
}

src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Copyright 2019 Octavian Oncescu
22

3-
#![cfg_attr(feature = "no_std", feature(alloc))]
43
#![cfg_attr(feature = "no_std", no_std)]
54

65
//! # Graphlib

0 commit comments

Comments
 (0)