nom
nom copied to clipboard
Replaces broken tutorial code with working example
Hi,
This is a simple PR to fix some code in the documentation. The documentation itself is well written and gives newcomers a great idea for how this library is meant to be used, but the example code doesn't work. Others have pointed this out here.
I followed what the documentation code was attempting to do (it was trying to use the library as an example to parse HTTP request lines). So I put together the bare minimum to get the intended example working, keeping the original comments/typing as well.
I think this will get newcomers up and running with the library much faster and they'll be more motivated to use the library if the example code is working. Personally I still found the docs useful in understanding this library.
As an alternative, I've been experimenting with different ideas for nom in a fork which includes pulling the various markdown files into docs.rs which
- Puts all documentation in one place
- Ensures the documentation at least compiles
See https://github.com/epage/nom-experimental/pull/1
Looks very cool! Feel free to take what I wrote up if you like.