Macro nom::eof [−][src]
macro_rules! eof {
($i : expr,) => { ... };
}
Expand description
eof!()
returns its input if it is at the end of input data.
When we’re at the end of the data, this combinator will succeed.
named!(parser, eof!());
assert_eq!(parser(&b"abc"[..]), Err(Err::Error(Error::new(&b"abc"[..], ErrorKind::Eof))));
assert_eq!(parser(&b""[..]), Ok((&b""[..], &b""[..])));