From b29846fb72326dc04bc13fe11d07965879787533 Mon Sep 17 00:00:00 2001 From: krolxon Date: Wed, 1 May 2024 00:06:50 +0530 Subject: abide by the lord clippy --- src/queue.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/queue.rs') diff --git a/src/queue.rs b/src/queue.rs index 821c508..712bc2f 100755 --- a/src/queue.rs +++ b/src/queue.rs @@ -17,10 +17,8 @@ impl Queue { // Go to next item in list pub fn next(&mut self) { let len = self.list.len(); - if len != 0 { - if self.index < len - 1 { - self.index += 1; - } + if len != 0 && self.index < len - 1 { + self.index += 1; } } @@ -35,3 +33,9 @@ impl Queue { self.index = 0; } } + +impl Default for Queue { + fn default() -> Self { + Self::new() + } +} -- cgit v1.2.3