1
Fork 0
mirror of https://github.com/RGBCube/alejandra synced 2025-07-31 12:37:45 +00:00

test: increase coverage

This commit is contained in:
Kevin Amado 2022-01-28 00:16:33 -05:00
parent b6679fa6e3
commit 4e873a1fe4
No known key found for this signature in database
GPG key ID: FFF341057F503148

View file

@ -43,14 +43,6 @@ impl Children {
Children { children, current_index: 0 }
}
pub fn count(&self) -> usize {
self.children.len()
}
pub fn current_index(&self) -> usize {
self.current_index
}
pub fn get(&mut self, index: usize) -> Option<Child> {
if index + 1 > self.children.len() {
None
@ -66,14 +58,9 @@ impl Children {
}
pub fn get_remaining(&mut self) -> Vec<Child> {
if self.current_index < self.children.len() {
let remaining =
&self.children[self.current_index..self.children.len()];
self.current_index = self.children.len();
remaining.to_vec()
} else {
vec![]
}
let remaining = &self.children[self.current_index..self.children.len()];
self.current_index = self.children.len();
remaining.to_vec()
}
pub fn has_next(&self) -> bool {
@ -85,11 +72,7 @@ impl Children {
}
pub fn peek_prev(&mut self) -> Option<Child> {
if self.current_index >= 1 {
self.get(self.current_index - 1)
} else {
None
}
self.get(self.current_index - 1)
}
pub fn move_next(&mut self) {