use refs in ApiMethod
This commit is contained in:
parent
b90dcc34bb
commit
89feb6acdf
|
@ -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<Value, Error>,
|
||||
}
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ fn test_api_handler(param: Value) -> Result<Value, Error> {
|
|||
|
||||
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,
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue