scraps 2.2.0

Scraps is a portable CLI knowledge hub for managing interconnected Markdown documentation with Wiki-link notation.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use scraps_libs::model::scrap::Scrap;

#[derive(Clone)]
pub enum Paging {
    Not,
    By(usize),
}

impl Paging {
    pub fn size_with(&self, scraps: &[Scrap]) -> usize {
        match self {
            Paging::Not => scraps.len(),
            Paging::By(size) => size.to_owned(),
        }
    }
}