From a93e8e7a02390e082456ecd66bdaa8bf834246a5 Mon Sep 17 00:00:00 2001 From: Joel Wachsler Date: Tue, 19 Jul 2022 22:41:35 +0000 Subject: [PATCH] Re-use to types --- .../src/parser/group/method/return_type.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/qbittorrent-web-api-gen/src/parser/group/method/return_type.rs b/qbittorrent-web-api-gen/src/parser/group/method/return_type.rs index 6b8fc5b..f7a4c45 100644 --- a/qbittorrent-web-api-gen/src/parser/group/method/return_type.rs +++ b/qbittorrent-web-api-gen/src/parser/group/method/return_type.rs @@ -92,20 +92,16 @@ impl md_parser::Table { impl md_parser::TableRow { fn to_return_type_parameter( &self, - types: &HashMap, + type_map: &HashMap, ) -> ReturnTypeParameter { let columns = &self.columns; ReturnTypeParameter { name: columns[0].clone(), description: columns[2].clone(), - return_type: types::Type::from( - &columns[1], - &columns[0], - Some(columns[2].clone()), - types, - ) - .unwrap_or_else(|| panic!("Failed to parse type {}", &columns[1])), + return_type: self + .to_types_with_types(type_map) + .unwrap_or_else(|| panic!("Failed to parse type {}", &columns[1])), } } }