summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2019-12-24 08:12:51 +0000
committerDaniel Silverstone <dsilvers@digital-scurf.org>2019-12-24 08:12:51 +0000
commitaf26b0fa9dab8a7dec7772412254a5c9bb25180a (patch)
tree8256ffc3f0f90797212f491e2538669112e2cb35
parentef6b2cdbc16af833e64831389abd96f1423a9d06 (diff)
downloadparsebyregex-af26b0fa9dab8a7dec7772412254a5c9bb25180a.tar.bz2
Move clippy shusher
-rw-r--r--parsebyregex-derive/src/lib.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/parsebyregex-derive/src/lib.rs b/parsebyregex-derive/src/lib.rs
index 223f7ee..8cd5e84 100644
--- a/parsebyregex-derive/src/lib.rs
+++ b/parsebyregex-derive/src/lib.rs
@@ -24,11 +24,11 @@ fn impl_pbr_macro(ast: &syn::DeriveInput) -> TokenStream {
let body = gen_struct_body(&name, &regex);
quote! {
impl ParseByRegex for #name {
+ #[allow(clippy::trivial_regex)]
fn parse_by_regex<T: AsRef<str>>(input: T) -> std::result::Result<Self, Box<dyn std::error::Error>> {
use parsebyregex::lazy_static;
use parsebyregex::Regex;
lazy_static! {
- #[allow(clippy::trivial_regex)]
static ref PARSER: Regex = Regex::new(#regex).expect("Unable to parse regular expression");
}
if let Some(captures) = PARSER.captures(input.as_ref()) {
@@ -50,6 +50,7 @@ fn impl_pbr_macro(ast: &syn::DeriveInput) -> TokenStream {
let body = gen_enum_body(&name, &edata);
quote! {
impl ParseByRegex for #name {
+ #[allow(clippy::trivial_regex)]
fn parse_by_regex<T: AsRef<str>>(input: T) -> std::result::Result<Self, Box<dyn std::error::Error>> {
use parsebyregex::lazy_static;
use parsebyregex::Regex;