Some(page_index - 1) } else { None }, next_page: if (page_index + 1) * 100 <= num_inscriptions { Some(page_index + 1) } else { None }, }) } } impl PageContent for InscriptionsBlockHtml { fn title(&self) -> String { format!("Inscriptions in Block {0}", self.block) } } #[cfg(test)] mod tests { use super::*; #[test] fn without_prev_and_next() { assert_regex_match!( InscriptionsBlockHtml { block: 21, inscriptions: vec![inscription_id(1), inscription_id(2)], prev_block: None, next_block: None, prev_page: None, next_page: None, }, "

Inscriptions in Block 21

.* prev next .* "