From 0a33b128513b8d24048d526b9abec13c36f357fc Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Wed, 7 Nov 2018 13:01:14 +0100 Subject: [PATCH] try to reduce space usage in ApiStringFormat by using Box --- src/json_schema.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/json_schema.rs b/src/json_schema.rs index 982cc66b..411467ca 100644 --- a/src/json_schema.rs +++ b/src/json_schema.rs @@ -97,7 +97,7 @@ pub const DEFAULTSTRING: JssString = JssString { #[derive(Debug)] pub enum ApiStringFormat { None, - Pattern(Regex), + Pattern(Box), Complex(Box), } @@ -339,7 +339,7 @@ fn test_query_string() { let schema = parameter!{name => ApiString!{ optional => false, - format => ApiStringFormat::Pattern(Regex::new("test").unwrap()) + format => ApiStringFormat::Pattern(Box::new(Regex::new("test").unwrap())) }}; let res = parse_query_string("name=abcd", &schema, true); @@ -350,7 +350,7 @@ fn test_query_string() { let schema = parameter!{name => ApiString!{ optional => false, - format => ApiStringFormat::Pattern(Regex::new("^test$").unwrap()) + format => ApiStringFormat::Pattern(Box::new(Regex::new("^test$").unwrap())) }}; let res = parse_query_string("name=ateststring", &schema, true);