Skip to main content

parse_page_range

Function parse_page_range 

Source
pub fn parse_page_range(s: &str) -> Result<(usize, usize), String>
Expand description

Parse a user-facing page-range string (issue #80’s --pages): "A-B" for an inclusive 1-based window, or a single "N" for one page. Whitespace around the numbers is tolerated. Validation against the actual page count happens at convert time; this only checks the spelling (first >= 1, first <= last).