Function parsa::builtins::whitespace

source ·
pub fn whitespace(s: &mut ParserString) -> Result<usize, Infallible>
Expand description

Removes leading whitespace in string, returning the amount.

This function returns Infallible as its error type, and thus can never fail. If you derive FromNever, this type will coerce implicitly.

let mut input = ParserString::from("    abc");
let ctr = whitespace(&mut input).unwrap(); // function can never fail
assert_eq!(ctr, 4);