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,19 +92,15 @@ impl md_parser::Table {
impl md_parser::TableRow {
fn to_return_type_parameter(
&self,
types: &HashMap<String, types::TypeDescription>,
type_map: &HashMap<String, types::TypeDescription>,
) -> 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,
)
return_type: self
.to_types_with_types(type_map)
.unwrap_or_else(|| panic!("Failed to parse type {}", &columns[1])),
}
}