Skip to content

Commit 02555b7

Browse files
committed
Fix rustc warnings for generator crate
1 parent ece783b commit 02555b7

File tree

2 files changed

+2
-27
lines changed

2 files changed

+2
-27
lines changed

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@ members = [
2323
"tripactions",
2424
"zoom"
2525
]
26+
27+
resolver = "2"

generator/src/main.rs

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -382,23 +382,9 @@ impl ParameterDataExt for openapiv3::ParameterData {
382382

383383
trait ExtractJsonMediaType {
384384
fn is_binary(&self) -> Result<bool>;
385-
fn content_json(&self) -> Result<openapiv3::MediaType>;
386385
}
387386

388387
impl ExtractJsonMediaType for openapiv3::Response {
389-
fn content_json(&self) -> Result<openapiv3::MediaType> {
390-
// We do not need to check the length of the content because there might be
391-
// more than one. For example, if xml or some other format is also defined.
392-
if let Some(mt) = self.content.get("application/json") {
393-
Ok(mt.clone())
394-
} else {
395-
bail!(
396-
"could not find application/json, only found {}",
397-
self.content.keys().next().unwrap()
398-
);
399-
}
400-
}
401-
402388
fn is_binary(&self) -> Result<bool> {
403389
if self.content.is_empty() {
404390
/*
@@ -460,19 +446,6 @@ impl ExtractJsonMediaType for openapiv3::Response {
460446
}
461447

462448
impl ExtractJsonMediaType for openapiv3::RequestBody {
463-
fn content_json(&self) -> Result<openapiv3::MediaType> {
464-
// We do not need to check the length of the content because there might be
465-
// more than one. For example, if xml or some other format is also defined.
466-
if let Some(mt) = self.content.get("application/json") {
467-
Ok(mt.clone())
468-
} else {
469-
bail!(
470-
"could not find application/json, only found {}",
471-
self.content.keys().next().unwrap()
472-
);
473-
}
474-
}
475-
476449
fn is_binary(&self) -> Result<bool> {
477450
if self.content.is_empty() {
478451
/*

0 commit comments

Comments
 (0)