()
| 259 | let prev = pos |
| 260 | .checked_sub(1) |
| 261 | .and_then(|index| pages.get(index).copied()); |
| 262 | let next = pages.get(pos + 1).copied(); |
| 263 | (prev, next) |
| 264 | } |
| 265 | |
| 266 | pub fn markdown_html(markdown: &str) -> String { |
| 267 | highlight::markdown_html(markdown) |
| 268 | } |
| 269 | |
| 270 | fn doc_matches(doc: &DocPage, needle: &str) -> bool { |
| 271 | doc.search_text.contains(needle) |
| 272 | } |
| 273 | |
| 274 | #[cfg(test)] |
| 275 | mod tests { |
| 276 | use super::{docs, find_doc, markdown_html}; |
| 277 | use pulldown_cmark::{Event, Parser, Tag}; |
| 278 | use std::{ |
| 279 | collections::{BTreeMap, BTreeSet}, |
| 280 | fs, |
| 281 | path::{Path, PathBuf}, |
| 282 | }; |
nothing calls this directly
no test coverage detected