diff --git a/src/api_info.rs b/src/api_info.rs index 45863f84..e1262278 100644 --- a/src/api_info.rs +++ b/src/api_info.rs @@ -5,8 +5,8 @@ use serde_json::{Value}; pub struct ApiMethod { pub description: &'static str, - pub properties: StaticPropertyMap, - pub returns: Jss, + pub properties: &'static StaticPropertyMap, + pub returns: &'static Jss, pub handler: fn(Value) -> Result, } diff --git a/src/main.rs b/src/main.rs index cd5338f4..8a6186d6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -97,7 +97,7 @@ fn test_api_handler(param: Value) -> Result { static TEST_API_METHOD: ApiMethod = ApiMethod { description: "This is a simple test.", - properties: StaticPropertyMap { + properties: &StaticPropertyMap { entries: &[ ("force", Boolean!{ optional => Some(true), @@ -105,7 +105,7 @@ static TEST_API_METHOD: ApiMethod = ApiMethod { }) ] }, - returns: Jss::Null, + returns: &Jss::Null, handler: test_api_handler, };