Linter fixes
This commit is contained in:
@@ -50,7 +50,7 @@ impl<I: ListItem + Clone> ApiResult<I> {
|
||||
}
|
||||
|
||||
pub fn at_end(&self) -> bool {
|
||||
(self.offset() + self.limit as u32) >= self.total
|
||||
(self.offset() + self.limit) >= self.total
|
||||
}
|
||||
|
||||
pub fn apply_pagination(self, pagination: &Pagination<I>) {
|
||||
@@ -66,7 +66,7 @@ impl<I: ListItem + Clone> ApiResult<I> {
|
||||
}
|
||||
|
||||
pub fn next(&self) -> Option<Vec<I>> {
|
||||
let offset = self.offset() + self.limit as u32;
|
||||
let offset = self.offset() + self.limit;
|
||||
debug!("fetching next page at offset {}", offset);
|
||||
if !self.at_end() {
|
||||
if let Some(next_page) = (self.fetch_page)(offset) {
|
||||
|
||||
@@ -151,13 +151,13 @@ impl ViewExt for QueueView {
|
||||
ShiftMode::Up if selected > 0 => {
|
||||
self.queue
|
||||
.shift(selected, (selected as i32).saturating_sub(amount) as usize);
|
||||
self.list.move_focus(-(amount as i32));
|
||||
self.list.move_focus(-amount);
|
||||
return Ok(CommandResult::Consumed(None));
|
||||
}
|
||||
ShiftMode::Down if selected < len.saturating_sub(1) => {
|
||||
self.queue
|
||||
.shift(selected, min(selected + amount as usize, len - 1));
|
||||
self.list.move_focus(amount as i32);
|
||||
self.list.move_focus(amount);
|
||||
return Ok(CommandResult::Consumed(None));
|
||||
}
|
||||
_ => {}
|
||||
|
||||
Reference in New Issue
Block a user