From 331ab992d7b5ded9d12962432a14532087dd9b5c Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Sat, 3 Nov 2018 10:50:24 +0100 Subject: [PATCH] use const for default object initializers --- src/json_schema.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/json_schema.rs b/src/json_schema.rs index 4e8ef827..0fcd7684 100644 --- a/src/json_schema.rs +++ b/src/json_schema.rs @@ -52,7 +52,7 @@ pub enum Jss<'a> { Array(JssArray<'a>), } -pub static DEFAULTBOOL: JssBoolean = JssBoolean { +pub const DEFAULTBOOL: JssBoolean = JssBoolean { description: "", optional: None, default: None, @@ -65,7 +65,7 @@ macro_rules! Boolean { }} } -pub static DEFAULTINTEGER: JssInteger = JssInteger { +pub const DEFAULTINTEGER: JssInteger = JssInteger { description: "", optional: None, default: None, @@ -80,7 +80,7 @@ macro_rules! Integer { }} } -pub static DEFAULTSTRING: JssString = JssString { +pub const DEFAULTSTRING: JssString = JssString { description: "", optional: None, default: None, @@ -95,7 +95,7 @@ macro_rules! ApiString { }} } -pub static DEFAULTARRAY: JssArray = JssArray { +pub const DEFAULTARRAY: JssArray = JssArray { description: "", optional: None, items: &Jss::Null, // is this a reasonable default?? @@ -108,9 +108,9 @@ macro_rules! Array { }} } -pub static EMPTYOBJECT: PropertyMap = PropertyMap { entries: &[] }; +pub const EMPTYOBJECT: PropertyMap = PropertyMap { entries: &[] }; -pub static DEFAULTOBJECT: JssObject = JssObject { +pub const DEFAULTOBJECT: JssObject = JssObject { description: "", optional: None, additional_properties: None,