[][src]Macro nom::eof

macro_rules! eof {
    ($i:expr,) => { ... };
}

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((&b"abc"[..], ErrorKind::Eof))));
 assert_eq!(parser(&b""[..]), Ok((&b""[..], &b""[..])));