Re-use to types

This commit is contained in:
Joel Wachsler 2022-07-19 22:41:35 +00:00
parent 135f4861ff
commit a93e8e7a02

View File

@ -92,20 +92,16 @@ impl md_parser::Table {
impl md_parser::TableRow { impl md_parser::TableRow {
fn to_return_type_parameter( fn to_return_type_parameter(
&self, &self,
types: &HashMap<String, types::TypeDescription>, type_map: &HashMap<String, types::TypeDescription>,
) -> ReturnTypeParameter { ) -> ReturnTypeParameter {
let columns = &self.columns; let columns = &self.columns;
ReturnTypeParameter { ReturnTypeParameter {
name: columns[0].clone(), name: columns[0].clone(),
description: columns[2].clone(), description: columns[2].clone(),
return_type: types::Type::from( return_type: self
&columns[1], .to_types_with_types(type_map)
&columns[0], .unwrap_or_else(|| panic!("Failed to parse type {}", &columns[1])),
Some(columns[2].clone()),
types,
)
.unwrap_or_else(|| panic!("Failed to parse type {}", &columns[1])),
} }
} }
} }