Closed tchajed closed 1 year ago
Formerly this example wouldn't parse single-letter identifiers, which might confuse someone using it directly.
If you'd like, another possible improvement is to make the doc test run and add the following to main:
fn main() { doc::identifier("a").expect("a"); doc::identifier("foo1").expect("foo1"); doc::identifier("1up").expect_err("starts with number"); doc::identifier("hello there").expect_err("has a space"); }
Good find, thanks!
Formerly this example wouldn't parse single-letter identifiers, which might confuse someone using it directly.
If you'd like, another possible improvement is to make the doc test run and add the following to main: