From 4ceb1ef302e386df60e671e2e3829ffe6d0b46f7 Mon Sep 17 00:00:00 2001 From: Dominic Date: Mon, 30 Sep 2019 18:20:22 +0200 Subject: [PATCH] fix panic --- src/openapi.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/openapi.rs b/src/openapi.rs index d5aff5f..c67f518 100644 --- a/src/openapi.rs +++ b/src/openapi.rs @@ -156,19 +156,19 @@ macro_rules! implOpenapiRouter { let path = &self.1; let mut item = (self.0).1.remove_path(path); let mut content : IndexMap = IndexMap::new(); - content[&APPLICATION_JSON.to_string()] = MediaType { + content.insert(APPLICATION_JSON.to_string(), MediaType { schema: None, // TODO example: None, examples: IndexMap::new(), encoding: IndexMap::new() - }; + }); let mut responses : IndexMap> = IndexMap::new(); - responses[&StatusCode::Code(200)] = Item(Response { + responses.insert(StatusCode::Code(200), Item(Response { description: "OK".to_string(), headers: IndexMap::new(), content, links: IndexMap::new() - }); + })); item.get = Some(Operation { tags: Vec::new(), summary: None,