Skip to content

Commit 2a3b45e

Browse files
authored
Making sure all checks succeed
1 parent bb3de57 commit 2a3b45e

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/data_structures/queue_using_singly_linked_list.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ impl<T> Node<T> {
3434

3535
/// Queue Implementation using Singly Linked List logic
3636
#[derive(Clone)]
37-
struct Queue<T> {
37+
pub struct Queue<T> {
3838
length: usize,
3939
head: Option<Box<Node<T>>>,
4040
tail: Option<Box<Node<T>>>,
@@ -189,7 +189,6 @@ impl<T> Queue<T> {
189189
// Get element by index from the queue
190190
pub fn get(&self, index: usize) -> Option<&T> {
191191
let mut counter = 0;
192-
193192
// If index == 0, it returns the first element from the queue, using the peek_front
194193
if index == 0 {
195194
return self.peek_front();
@@ -204,9 +203,7 @@ impl<T> Queue<T> {
204203
}
205204

206205
let mut _current = &self.head;
207-
208206
let mut get_node: Option<&T> = None;
209-
210207
// If the node was not got we also index through the tail
211208
if get_node.is_none() {
212209
// Setting current to now be the tail

0 commit comments

Comments
 (0)