From eda81b84cc348c558338d4705103894e7ef27d0d Mon Sep 17 00:00:00 2001 From: Canop Date: Tue, 3 Jan 2023 11:52:02 +0100 Subject: [PATCH] clearer doc with compile_fail --- Cargo.toml | 2 +- src/lib.rs | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3059d68..1fcbae6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ license = "MIT" categories = ["text-processing"] repository = "https://github.com/Canop/lazy-regex" readme = "README.md" -rust-version = "1.56" +rust-version = "1.65" [dependencies] once_cell = "1.7" diff --git a/src/lib.rs b/src/lib.rs index c832953..18635d6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -58,8 +58,10 @@ let r = regex!(r#"(?x) assert_eq!(r.find("This is lazy_regex-2.2!").unwrap().as_str(), "lazy_regex-2.2"); // (look at the regex_captures! macro to easily extract the groups) -// this line wouldn't compile because the regex is invalid: -// let r = regex!("(unclosed"); +``` +```compile_fail +// this line doesn't compile because the regex is invalid: +let r = regex!("(unclosed"); ``` Supported regex flags: `i`, `m`, `s`, `x`, `U`.