summaryrefslogtreecommitdiffstats
path: root/generator/src/main.rs
diff options
context:
space:
mode:
authorCyborus <cyborus@cyborus.xyz>2024-03-20 18:11:47 +0100
committerCyborus <cyborus@cyborus.xyz>2024-03-20 18:11:47 +0100
commit9e3279e7ed0f41e81331b511899ec5c2776b1fca (patch)
tree255093a93f65314ebd76abc3d457d70ba8014230 /generator/src/main.rs
parentremove structs that only exist for their `additional` field (diff)
downloadforgejo-api-9e3279e7ed0f41e81331b511899ec5c2776b1fca.tar.xz
forgejo-api-9e3279e7ed0f41e81331b511899ec5c2776b1fca.zip
two small `BTreeMap`-related changes
import `BTreeMap` instead of qualified path use `BTreeMap` instead of `serde_json::Map`
Diffstat (limited to 'generator/src/main.rs')
-rw-r--r--generator/src/main.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/generator/src/main.rs b/generator/src/main.rs
index 9a5abee..64173bf 100644
--- a/generator/src/main.rs
+++ b/generator/src/main.rs
@@ -105,7 +105,7 @@ fn schema_type_name(
// Checking for a space filters that out
(Some(title), _) if !title.contains(' ') => title.to_string(),
(_, Some(definition_name)) => definition_name.to_string(),
- (_, None) => "serde_json::Map<String, serde_json::Value>".to_string(),
+ (_, None) => "BTreeMap<String, serde_json::Value>".to_string(),
}
}
};
@@ -223,7 +223,7 @@ fn schema_subtype_name(
let additional = additional.deref(spec)?;
let mut additional_ty = crate::schema_type_name(spec, None, additional)?;
schema_subtype_name(spec, parent_name, name, additional, &mut additional_ty)?;
- *ty = format!("std::collections::BTreeMap<String, {additional_ty}>");
+ *ty = format!("BTreeMap<String, {additional_ty}>");
true
}
Schema {