(dmmf) Simplify RenderContext::add_mapping()
@@ -85,8 +85,7 @@ impl RenderContext {
}
pub fn add_mapping(&mut self, name: String, operation: Option<&SchemaQueryBuilder>) {
- operation.into_iter().for_each(|op| {
- if let SchemaQueryBuilder::ModelQueryBuilder(m) = op {
+ if let Some(SchemaQueryBuilder::ModelQueryBuilder(m)) = operation {
let model_name = m.model.name.clone();
let tag_str = format!("{}", m.tag);
let mapping = self.mappings.iter().find(|mapping| mapping.model_name == model_name);
@@ -101,7 +100,6 @@ impl RenderContext {
}
};
}
- });
}
}
