Skip to content

Commit cd9a248

Browse files
committed
Avoid unnecessary unwrap in YAML conversion
Fixes the clippy::unnecessary_unwrap lint error reported by Clippy 1.98. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: aaf47101-2cb9-4d38-9f6a-e492c4da4135
1 parent 19b2f84 commit cd9a248

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎shared/yeast-schema/src/node_types_yaml.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,11 @@ pub fn convert(yaml_input: &str) -> Result<String, String> {
205205
"types": types,
206206
});
207207

208-
if spec.name.is_none() {
208+
if let Some(name) = spec.name {
209+
json_fields.insert(name, field_info);
210+
} else {
209211
// $children
210212
json_children = Some(field_info);
211-
} else {
212-
json_fields.insert(spec.name.unwrap(), field_info);
213213
}
214214
}
215215

0 commit comments

Comments
 (0)