summaryrefslogtreecommitdiffstats
path: root/src
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 /src
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 'src')
-rw-r--r--src/generated/methods.rs3
-rw-r--r--src/generated/structs.rs19
2 files changed, 12 insertions, 10 deletions
diff --git a/src/generated/methods.rs b/src/generated/methods.rs
index 9afc13e..0f6a97b 100644
--- a/src/generated/methods.rs
+++ b/src/generated/methods.rs
@@ -1,5 +1,6 @@
use super::structs::*;
use crate::ForgejoError;
+use std::collections::BTreeMap;
impl crate::Forgejo {
/// Returns the Person actor for a user
@@ -4119,7 +4120,7 @@ impl crate::Forgejo {
&self,
owner: &str,
repo: &str,
- ) -> Result<std::collections::BTreeMap<String, u64>, ForgejoError> {
+ ) -> Result<BTreeMap<String, u64>, ForgejoError> {
let request = self
.get(&format!("repos/{owner}/{repo}/languages"))
.build()?;
diff --git a/src/generated/structs.rs b/src/generated/structs.rs
index 34764b6..7b8b25f 100644
--- a/src/generated/structs.rs
+++ b/src/generated/structs.rs
@@ -1,4 +1,5 @@
use crate::StructureError;
+use std::collections::BTreeMap;
/// APIError is an api error with a message
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct APIError {
@@ -496,7 +497,7 @@ pub enum CreateHookOptionType {
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct CreateHookOptionConfig {
#[serde(flatten)]
- pub additional: std::collections::BTreeMap<String, String>,
+ pub additional: BTreeMap<String, String>,
}
/// CreateIssueCommentOption options for creating a comment on an issue
@@ -727,7 +728,7 @@ pub struct CreateTeamOption {
pub name: String,
pub permission: Option<CreateTeamOptionPermission>,
pub units: Option<Vec<String>>,
- pub units_map: Option<std::collections::BTreeMap<String, String>>,
+ pub units_map: Option<BTreeMap<String, String>>,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
@@ -892,7 +893,7 @@ pub struct EditHookOption {
pub active: Option<bool>,
pub authorization_header: Option<String>,
pub branch_filter: Option<String>,
- pub config: Option<std::collections::BTreeMap<String, String>>,
+ pub config: Option<BTreeMap<String, String>>,
pub events: Option<Vec<String>>,
}
@@ -1076,7 +1077,7 @@ pub struct EditTeamOption {
pub name: String,
pub permission: Option<EditTeamOptionPermission>,
pub units: Option<Vec<String>>,
- pub units_map: Option<std::collections::BTreeMap<String, String>>,
+ pub units_map: Option<BTreeMap<String, String>>,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
@@ -1351,7 +1352,7 @@ pub struct Hook {
pub active: Option<bool>,
pub authorization_header: Option<String>,
pub branch_filter: Option<String>,
- pub config: Option<std::collections::BTreeMap<String, String>>,
+ pub config: Option<BTreeMap<String, String>>,
#[serde(with = "time::serde::rfc3339::option")]
pub created_at: Option<time::OffsetDateTime>,
pub events: Option<Vec<String>>,
@@ -1447,11 +1448,11 @@ pub struct IssueDeadline {
/// IssueFormField represents a form field
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct IssueFormField {
- pub attributes: Option<std::collections::BTreeMap<String, serde_json::Value>>,
+ pub attributes: Option<BTreeMap<String, serde_json::Value>>,
pub id: Option<String>,
#[serde(rename = "type")]
pub r#type: Option<String>,
- pub validations: Option<std::collections::BTreeMap<String, serde_json::Value>>,
+ pub validations: Option<BTreeMap<String, serde_json::Value>>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
@@ -1710,7 +1711,7 @@ pub struct NewIssuePinsAllowed {
/// NodeInfo contains standardized way of exposing metadata about a server running one of the distributed social networks
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct NodeInfo {
- pub metadata: Option<serde_json::Map<String, serde_json::Value>>,
+ pub metadata: Option<BTreeMap<String, serde_json::Value>>,
#[serde(rename = "openRegistrations")]
pub open_registrations: Option<bool>,
pub protocols: Option<Vec<String>>,
@@ -2308,7 +2309,7 @@ pub struct Team {
pub organization: Option<Organization>,
pub permission: Option<TeamPermission>,
pub units: Option<Vec<String>>,
- pub units_map: Option<std::collections::BTreeMap<String, String>>,
+ pub units_map: Option<BTreeMap<String, String>>,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]