Skip to content

Instantly share code, notes, and snippets.

Created Jun 10, 2020
What would you like to do?
Code shared from the Rust Playground
fn nom_str_until_eol(i: &str) -> nom::IResult<&str, &str> {
let first_line = i.lines().next();
if let Some(first_line) = first_line {
let rest = &i[first_line.len()..];
let rest = rest.trim();
Ok((rest, first_line))
} else {
Ok((i, ""))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment