From 1eb9add9b5007915b4797a032ea0cc80d1433857 Mon Sep 17 00:00:00 2001 From: nanato12 Date: Sat, 2 Dec 2023 03:01:24 +0900 Subject: [PATCH] update: generator --- generator/src/main.rs | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/generator/src/main.rs b/generator/src/main.rs index f663d3c2..fc09b5ee 100644 --- a/generator/src/main.rs +++ b/generator/src/main.rs @@ -63,7 +63,7 @@ fn fix_openapi_webhook(file_path: &Path) { } fn fix_openapi_manage_audience(file_path: &Path) { - let mut replacements: HashMap<&str, &str> = [ + let replacements: HashMap<&str, &str> = [ ( "status: Option", "status: Option", @@ -77,6 +77,18 @@ fn fix_openapi_manage_audience(file_path: &Path) { .cloned() .collect(); + replace_in_file(file_path, replacements); +} + +fn fix_openapi_messaging_api(file_path: &Path) { + let mut replacements: HashMap<&str, &str> = [( + "pub enum AreaDemographic", + "#[allow(non_camel_case_types)]\npub enum AreaDemographic", + )] + .iter() + .cloned() + .collect(); + let p = file_path.to_str().unwrap(); // delete type from event, source, message_content @@ -89,19 +101,6 @@ fn fix_openapi_manage_audience(file_path: &Path) { replacements.insert("/// Type of message", ""); } } - - replace_in_file(file_path, replacements); -} - -fn fix_openapi_messaging_api(file_path: &Path) { - let replacements: HashMap<&str, &str> = [( - "pub enum AreaDemographic", - "#[allow(non_camel_case_types)]\npub enum AreaDemographic", - )] - .iter() - .cloned() - .collect(); - replace_in_file(file_path, replacements); }