From 02555b75c9013341fee0a32529b191e6d542fafe Mon Sep 17 00:00:00 2001 From: Lucas Kent Date: Tue, 26 Aug 2025 21:37:00 +1000 Subject: [PATCH] Fix rustc warnings for generator crate --- Cargo.toml | 2 ++ generator/src/main.rs | 27 --------------------------- 2 files changed, 2 insertions(+), 27 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 8c5d873c..266b80fd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,3 +23,5 @@ members = [ "tripactions", "zoom" ] + +resolver = "2" diff --git a/generator/src/main.rs b/generator/src/main.rs index 14adaefd..5d8dfa24 100644 --- a/generator/src/main.rs +++ b/generator/src/main.rs @@ -382,23 +382,9 @@ impl ParameterDataExt for openapiv3::ParameterData { trait ExtractJsonMediaType { fn is_binary(&self) -> Result; - fn content_json(&self) -> Result; } impl ExtractJsonMediaType for openapiv3::Response { - fn content_json(&self) -> Result { - // We do not need to check the length of the content because there might be - // more than one. For example, if xml or some other format is also defined. - if let Some(mt) = self.content.get("application/json") { - Ok(mt.clone()) - } else { - bail!( - "could not find application/json, only found {}", - self.content.keys().next().unwrap() - ); - } - } - fn is_binary(&self) -> Result { if self.content.is_empty() { /* @@ -460,19 +446,6 @@ impl ExtractJsonMediaType for openapiv3::Response { } impl ExtractJsonMediaType for openapiv3::RequestBody { - fn content_json(&self) -> Result { - // We do not need to check the length of the content because there might be - // more than one. For example, if xml or some other format is also defined. - if let Some(mt) = self.content.get("application/json") { - Ok(mt.clone()) - } else { - bail!( - "could not find application/json, only found {}", - self.content.keys().next().unwrap() - ); - } - } - fn is_binary(&self) -> Result { if self.content.is_empty() { /*