aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md10
-rw-r--r--src/lib.rs4
2 files changed, 8 insertions, 6 deletions
diff --git a/README.md b/README.md
index 91b8e71..744a530 100644
--- a/README.md
+++ b/README.md
@@ -33,7 +33,7 @@ for (actual, expected) in match_info.zip(expected) {
}
```
-# Example: replacement with named capture groups
+## Example: replacement with named capture groups
```rust
use bird_machine::{bird_machine, Machine};
@@ -49,11 +49,13 @@ let after = Date::replace_all(before, "$m/$d/$y");
assert_eq!(after, "03/14/2012, 01/01/2013 and 07/05/2014");
```
-# Example: compile-time rejection of invalid regular expressions
+## Example: compile-time rejection of invalid regular expressions
-```rust,compile_fail
+```rust
use bird_machine::bird_machine;
+// this will not compile
#[bird_machine(r"(oops i left this group open")]
struct Bad;
-``` \ No newline at end of file
+```
+
diff --git a/src/lib.rs b/src/lib.rs
index a886aa0..1125d73 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -33,7 +33,7 @@
//! }
//! ```
//!
-//! # Example: replacement with named capture groups
+//! ## Example: replacement with named capture groups
//!
//! ```rust
//! use bird_machine::{bird_machine, Machine};
@@ -49,7 +49,7 @@
//! assert_eq!(after, "03/14/2012, 01/01/2013 and 07/05/2014");
//! ```
//!
-//! # Example: compile-time rejection of invalid regular expressions
+//! ## Example: compile-time rejection of invalid regular expressions
//!
//! ```rust,compile_fail
//! use bird_machine::bird_machine;