diff --git a/modules/openapi-generator/src/main/resources/rust-server/client-operation.mustache b/modules/openapi-generator/src/main/resources/rust-server/client-operation.mustache index a93adb61e0db..c858295ce903 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/client-operation.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/client-operation.mustache @@ -359,6 +359,7 @@ {{/-first}} {{^isMap}} {{^required}} + #[allow(clippy::single_match)] match param_{{{paramName}}} { Some(param_{{{paramName}}}) => { {{/required}} diff --git a/modules/openapi-generator/src/main/resources/rust-server/lib.mustache b/modules/openapi-generator/src/main/resources/rust-server/lib.mustache index c642b08a65fa..f82fe6f424e2 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/lib.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/lib.mustache @@ -1,6 +1,6 @@ #![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] #![allow(unused_imports, unused_attributes)] -#![allow(clippy::derive_partial_eq_without_eq, clippy::blacklisted_name)] +#![allow(clippy::derive_partial_eq_without_eq, clippy::disallowed_names)] use async_trait::async_trait; use futures::Stream; diff --git a/modules/openapi-generator/src/main/resources/rust-server/models.mustache b/modules/openapi-generator/src/main/resources/rust-server/models.mustache index 30be5a54f35f..89e45f904580 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/models.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/models.mustache @@ -189,7 +189,7 @@ impl<'a> std::iter::IntoIterator for &'a {{{classname}}} { type IntoIter = std::slice::Iter<'a, {{{arrayModelType}}}>; fn into_iter(self) -> Self::IntoIter { - (&self.0).iter() + self.0.iter() } } @@ -198,7 +198,7 @@ impl<'a> std::iter::IntoIterator for &'a mut {{{classname}}} { type IntoIter = std::slice::IterMut<'a, {{{arrayModelType}}}>; fn into_iter(self) -> Self::IntoIter { - (&mut self.0).iter_mut() + self.0.iter_mut() } } diff --git a/modules/openapi-generator/src/main/resources/rust-server/server-operation.mustache b/modules/openapi-generator/src/main/resources/rust-server/server-operation.mustache index a8ac8bbc8021..e7175b1745e9 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/server-operation.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/server-operation.mustache @@ -125,7 +125,7 @@ // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) let query_params = form_urlencoded::parse(uri.query().unwrap_or_default().as_bytes()).collect::>(); {{/-first}} - let param_{{{paramName}}} = query_params.iter().filter(|e| e.0 == "{{{baseName}}}").map(|e| e.1.to_owned()) + let param_{{{paramName}}} = query_params.iter().filter(|e| e.0 == "{{{baseName}}}").map(|e| e.1.clone()) {{#isArray}} {{^vendorExtensions.x-consumes-json}} .filter_map(|param_{{{paramName}}}| param_{{{paramName}}}.parse().ok()) @@ -221,7 +221,7 @@ let deserializer = &mut serde_xml_rs::de::Deserializer::new_from_reader(&*body); {{/x-consumes-xml}} {{#x-consumes-json}} - let deserializer = &mut serde_json::Deserializer::from_slice(&*body); + let deserializer = &mut serde_json::Deserializer::from_slice(&body); {{/x-consumes-json}} {{^x-consumes-plain-text}} match serde_ignored::deserialize(deserializer, |path| { diff --git a/samples/server/petstore/rust-server/output/multipart-v3/src/lib.rs b/samples/server/petstore/rust-server/output/multipart-v3/src/lib.rs index b1c50ab40a6f..6d043d4a086e 100644 --- a/samples/server/petstore/rust-server/output/multipart-v3/src/lib.rs +++ b/samples/server/petstore/rust-server/output/multipart-v3/src/lib.rs @@ -1,6 +1,6 @@ #![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] #![allow(unused_imports, unused_attributes)] -#![allow(clippy::derive_partial_eq_without_eq, clippy::blacklisted_name)] +#![allow(clippy::derive_partial_eq_without_eq, clippy::disallowed_names)] use async_trait::async_trait; use futures::Stream; diff --git a/samples/server/petstore/rust-server/output/no-example-v3/src/lib.rs b/samples/server/petstore/rust-server/output/no-example-v3/src/lib.rs index 05aca2b05b4e..35dd1cad90df 100644 --- a/samples/server/petstore/rust-server/output/no-example-v3/src/lib.rs +++ b/samples/server/petstore/rust-server/output/no-example-v3/src/lib.rs @@ -1,6 +1,6 @@ #![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] #![allow(unused_imports, unused_attributes)] -#![allow(clippy::derive_partial_eq_without_eq, clippy::blacklisted_name)] +#![allow(clippy::derive_partial_eq_without_eq, clippy::disallowed_names)] use async_trait::async_trait; use futures::Stream; diff --git a/samples/server/petstore/rust-server/output/no-example-v3/src/server/mod.rs b/samples/server/petstore/rust-server/output/no-example-v3/src/server/mod.rs index 6bd3627a9164..1e951f6e0e72 100644 --- a/samples/server/petstore/rust-server/output/no-example-v3/src/server/mod.rs +++ b/samples/server/petstore/rust-server/output/no-example-v3/src/server/mod.rs @@ -149,7 +149,7 @@ impl hyper::service::Service<(Request, C)> for Service where Ok(body) => { let mut unused_elements = Vec::new(); let param_op_get_request: Option = if !body.is_empty() { - let deserializer = &mut serde_json::Deserializer::from_slice(&*body); + let deserializer = &mut serde_json::Deserializer::from_slice(&body); match serde_ignored::deserialize(deserializer, |path| { warn!("Ignoring unknown field in body: {}", path); unused_elements.push(path.to_string()); diff --git a/samples/server/petstore/rust-server/output/openapi-v3/src/lib.rs b/samples/server/petstore/rust-server/output/openapi-v3/src/lib.rs index 1f5793d8bf14..d57ac04aef26 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/src/lib.rs +++ b/samples/server/petstore/rust-server/output/openapi-v3/src/lib.rs @@ -1,6 +1,6 @@ #![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] #![allow(unused_imports, unused_attributes)] -#![allow(clippy::derive_partial_eq_without_eq, clippy::blacklisted_name)] +#![allow(clippy::derive_partial_eq_without_eq, clippy::disallowed_names)] use async_trait::async_trait; use futures::Stream; diff --git a/samples/server/petstore/rust-server/output/openapi-v3/src/models.rs b/samples/server/petstore/rust-server/output/openapi-v3/src/models.rs index 2f238bd1d9f6..131ce5971709 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/src/models.rs +++ b/samples/server/petstore/rust-server/output/openapi-v3/src/models.rs @@ -111,7 +111,7 @@ impl<'a> std::iter::IntoIterator for &'a AnotherXmlArray { type IntoIter = std::slice::Iter<'a, String>; fn into_iter(self) -> Self::IntoIter { - (&self.0).iter() + self.0.iter() } } @@ -120,7 +120,7 @@ impl<'a> std::iter::IntoIterator for &'a mut AnotherXmlArray { type IntoIter = std::slice::IterMut<'a, String>; fn into_iter(self) -> Self::IntoIter { - (&mut self.0).iter_mut() + self.0.iter_mut() } } @@ -1499,7 +1499,7 @@ impl<'a> std::iter::IntoIterator for &'a MyIdList { type IntoIter = std::slice::Iter<'a, i32>; fn into_iter(self) -> Self::IntoIter { - (&self.0).iter() + self.0.iter() } } @@ -1508,7 +1508,7 @@ impl<'a> std::iter::IntoIterator for &'a mut MyIdList { type IntoIter = std::slice::IterMut<'a, i32>; fn into_iter(self) -> Self::IntoIter { - (&mut self.0).iter_mut() + self.0.iter_mut() } } @@ -2853,7 +2853,7 @@ impl<'a> std::iter::IntoIterator for &'a XmlArray { type IntoIter = std::slice::Iter<'a, String>; fn into_iter(self) -> Self::IntoIter { - (&self.0).iter() + self.0.iter() } } @@ -2862,7 +2862,7 @@ impl<'a> std::iter::IntoIterator for &'a mut XmlArray { type IntoIter = std::slice::IterMut<'a, String>; fn into_iter(self) -> Self::IntoIter { - (&mut self.0).iter_mut() + self.0.iter_mut() } } diff --git a/samples/server/petstore/rust-server/output/openapi-v3/src/server/callbacks.rs b/samples/server/petstore/rust-server/output/openapi-v3/src/server/callbacks.rs index 0486992669b5..5bda72e889d5 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/src/server/callbacks.rs +++ b/samples/server/petstore/rust-server/output/openapi-v3/src/server/callbacks.rs @@ -271,6 +271,7 @@ impl CallbackApi for Client where }); // Header parameters + #[allow(clippy::single_match)] match param_information { Some(param_information) => { request.headers_mut().append( diff --git a/samples/server/petstore/rust-server/output/openapi-v3/src/server/mod.rs b/samples/server/petstore/rust-server/output/openapi-v3/src/server/mod.rs index 66216f5a2f04..0d8be00926b7 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/src/server/mod.rs +++ b/samples/server/petstore/rust-server/output/openapi-v3/src/server/mod.rs @@ -228,7 +228,7 @@ impl hyper::service::Service<(Request, C)> for Service where hyper::Method::GET if path.matched(paths::ID_ANY_OF) => { // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) let query_params = form_urlencoded::parse(uri.query().unwrap_or_default().as_bytes()).collect::>(); - let param_any_of = query_params.iter().filter(|e| e.0 == "any-of").map(|e| e.1.to_owned()) + let param_any_of = query_params.iter().filter(|e| e.0 == "any-of").map(|e| e.1.clone()) .filter_map(|param_any_of| param_any_of.parse().ok()) .collect::>(); let param_any_of = if !param_any_of.is_empty() { @@ -298,7 +298,7 @@ impl hyper::service::Service<(Request, C)> for Service where hyper::Method::POST if path.matched(paths::ID_CALLBACK_WITH_HEADER) => { // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) let query_params = form_urlencoded::parse(uri.query().unwrap_or_default().as_bytes()).collect::>(); - let param_url = query_params.iter().filter(|e| e.0 == "url").map(|e| e.1.to_owned()) + let param_url = query_params.iter().filter(|e| e.0 == "url").map(|e| e.1.clone()) .next(); let param_url = match param_url { Some(param_url) => { @@ -355,7 +355,7 @@ impl hyper::service::Service<(Request, C)> for Service where hyper::Method::GET if path.matched(paths::ID_COMPLEX_QUERY_PARAM) => { // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) let query_params = form_urlencoded::parse(uri.query().unwrap_or_default().as_bytes()).collect::>(); - let param_list_of_strings = query_params.iter().filter(|e| e.0 == "list-of-strings").map(|e| e.1.to_owned()) + let param_list_of_strings = query_params.iter().filter(|e| e.0 == "list-of-strings").map(|e| e.1.clone()) .filter_map(|param_list_of_strings| param_list_of_strings.parse().ok()) .collect::>(); let param_list_of_strings = if !param_list_of_strings.is_empty() { @@ -449,7 +449,7 @@ impl hyper::service::Service<(Request, C)> for Service where hyper::Method::GET if path.matched(paths::ID_JSON_COMPLEX_QUERY_PARAM) => { // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) let query_params = form_urlencoded::parse(uri.query().unwrap_or_default().as_bytes()).collect::>(); - let param_list_of_strings = query_params.iter().filter(|e| e.0 == "list-of-strings").map(|e| e.1.to_owned()) + let param_list_of_strings = query_params.iter().filter(|e| e.0 == "list-of-strings").map(|e| e.1.clone()) .next(); let param_list_of_strings = match param_list_of_strings { Some(param_list_of_strings) => { @@ -814,7 +814,7 @@ impl hyper::service::Service<(Request, C)> for Service where hyper::Method::GET if path.matched(paths::ID_PARAMGET) => { // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) let query_params = form_urlencoded::parse(uri.query().unwrap_or_default().as_bytes()).collect::>(); - let param_uuid = query_params.iter().filter(|e| e.0 == "uuid").map(|e| e.1.to_owned()) + let param_uuid = query_params.iter().filter(|e| e.0 == "uuid").map(|e| e.1.clone()) .next(); let param_uuid = match param_uuid { Some(param_uuid) => { @@ -831,7 +831,7 @@ impl hyper::service::Service<(Request, C)> for Service where }, None => None, }; - let param_some_object = query_params.iter().filter(|e| e.0 == "someObject").map(|e| e.1.to_owned()) + let param_some_object = query_params.iter().filter(|e| e.0 == "someObject").map(|e| e.1.clone()) .next(); let param_some_object = match param_some_object { Some(param_some_object) => { @@ -848,7 +848,7 @@ impl hyper::service::Service<(Request, C)> for Service where }, None => None, }; - let param_some_list = query_params.iter().filter(|e| e.0 == "someList").map(|e| e.1.to_owned()) + let param_some_list = query_params.iter().filter(|e| e.0 == "someList").map(|e| e.1.clone()) .next(); let param_some_list = match param_some_list { Some(param_some_list) => { @@ -965,7 +965,7 @@ impl hyper::service::Service<(Request, C)> for Service where hyper::Method::POST if path.matched(paths::ID_REGISTER_CALLBACK) => { // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) let query_params = form_urlencoded::parse(uri.query().unwrap_or_default().as_bytes()).collect::>(); - let param_url = query_params.iter().filter(|e| e.0 == "url").map(|e| e.1.to_owned()) + let param_url = query_params.iter().filter(|e| e.0 == "url").map(|e| e.1.clone()) .next(); let param_url = match param_url { Some(param_url) => { @@ -1268,7 +1268,7 @@ impl hyper::service::Service<(Request, C)> for Service where Ok(body) => { let mut unused_elements = Vec::new(); let param_object_untyped_props: Option = if !body.is_empty() { - let deserializer = &mut serde_json::Deserializer::from_slice(&*body); + let deserializer = &mut serde_json::Deserializer::from_slice(&body); match serde_ignored::deserialize(deserializer, |path| { warn!("Ignoring unknown field in body: {}", path); unused_elements.push(path.to_string()); @@ -1713,7 +1713,7 @@ impl hyper::service::Service<(Request, C)> for Service where Ok(body) => { let mut unused_elements = Vec::new(); let param_object_param: Option = if !body.is_empty() { - let deserializer = &mut serde_json::Deserializer::from_slice(&*body); + let deserializer = &mut serde_json::Deserializer::from_slice(&body); match serde_ignored::deserialize(deserializer, |path| { warn!("Ignoring unknown field in body: {}", path); unused_elements.push(path.to_string()); diff --git a/samples/server/petstore/rust-server/output/ops-v3/src/lib.rs b/samples/server/petstore/rust-server/output/ops-v3/src/lib.rs index 4cc7e28f7397..bb16cef8ed5d 100644 --- a/samples/server/petstore/rust-server/output/ops-v3/src/lib.rs +++ b/samples/server/petstore/rust-server/output/ops-v3/src/lib.rs @@ -1,6 +1,6 @@ #![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] #![allow(unused_imports, unused_attributes)] -#![allow(clippy::derive_partial_eq_without_eq, clippy::blacklisted_name)] +#![allow(clippy::derive_partial_eq_without_eq, clippy::disallowed_names)] use async_trait::async_trait; use futures::Stream; diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/client/mod.rs b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/client/mod.rs index 0ea239e35c8f..27c40c08de79 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/client/mod.rs +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/client/mod.rs @@ -1442,6 +1442,7 @@ impl Api for Client where }); // Header parameters + #[allow(clippy::single_match)] match param_enum_header_string_array { Some(param_enum_header_string_array) => { request.headers_mut().append( @@ -1458,6 +1459,7 @@ impl Api for Client where None => {} } + #[allow(clippy::single_match)] match param_enum_header_string { Some(param_enum_header_string) => { request.headers_mut().append( @@ -1927,6 +1929,7 @@ impl Api for Client where } // Header parameters + #[allow(clippy::single_match)] match param_api_key { Some(param_api_key) => { request.headers_mut().append( diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/lib.rs b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/lib.rs index 18a5ecab0249..f652f1580e55 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/lib.rs +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/lib.rs @@ -1,6 +1,6 @@ #![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] #![allow(unused_imports, unused_attributes)] -#![allow(clippy::derive_partial_eq_without_eq, clippy::blacklisted_name)] +#![allow(clippy::derive_partial_eq_without_eq, clippy::disallowed_names)] use async_trait::async_trait; use futures::Stream; diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/models.rs b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/models.rs index faf92e4f9ace..da8bde6565d8 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/models.rs +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/models.rs @@ -322,7 +322,7 @@ impl<'a> std::iter::IntoIterator for &'a AnimalFarm { type IntoIter = std::slice::Iter<'a, Animal>; fn into_iter(self) -> Self::IntoIter { - (&self.0).iter() + self.0.iter() } } @@ -331,7 +331,7 @@ impl<'a> std::iter::IntoIterator for &'a mut AnimalFarm { type IntoIter = std::slice::IterMut<'a, Animal>; fn into_iter(self) -> Self::IntoIter { - (&mut self.0).iter_mut() + self.0.iter_mut() } } diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/server/mod.rs b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/server/mod.rs index e2366ba364d4..72dea2e7e685 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/server/mod.rs +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/server/mod.rs @@ -267,7 +267,7 @@ impl hyper::service::Service<(Request, C)> for Service where Ok(body) => { let mut unused_elements = Vec::new(); let param_body: Option = if !body.is_empty() { - let deserializer = &mut serde_json::Deserializer::from_slice(&*body); + let deserializer = &mut serde_json::Deserializer::from_slice(&body); match serde_ignored::deserialize(deserializer, |path| { warn!("Ignoring unknown field in body: {}", path); unused_elements.push(path.to_string()); @@ -376,7 +376,7 @@ impl hyper::service::Service<(Request, C)> for Service where Ok(body) => { let mut unused_elements = Vec::new(); let param_body: Option = if !body.is_empty() { - let deserializer = &mut serde_json::Deserializer::from_slice(&*body); + let deserializer = &mut serde_json::Deserializer::from_slice(&body); match serde_ignored::deserialize(deserializer, |path| { warn!("Ignoring unknown field in body: {}", path); unused_elements.push(path.to_string()); @@ -446,7 +446,7 @@ impl hyper::service::Service<(Request, C)> for Service where Ok(body) => { let mut unused_elements = Vec::new(); let param_body: Option = if !body.is_empty() { - let deserializer = &mut serde_json::Deserializer::from_slice(&*body); + let deserializer = &mut serde_json::Deserializer::from_slice(&body); match serde_ignored::deserialize(deserializer, |path| { warn!("Ignoring unknown field in body: {}", path); unused_elements.push(path.to_string()); @@ -516,7 +516,7 @@ impl hyper::service::Service<(Request, C)> for Service where Ok(body) => { let mut unused_elements = Vec::new(); let param_body: Option = if !body.is_empty() { - let deserializer = &mut serde_json::Deserializer::from_slice(&*body); + let deserializer = &mut serde_json::Deserializer::from_slice(&body); match serde_ignored::deserialize(deserializer, |path| { warn!("Ignoring unknown field in body: {}", path); unused_elements.push(path.to_string()); @@ -586,7 +586,7 @@ impl hyper::service::Service<(Request, C)> for Service where Ok(body) => { let mut unused_elements = Vec::new(); let param_body: Option = if !body.is_empty() { - let deserializer = &mut serde_json::Deserializer::from_slice(&*body); + let deserializer = &mut serde_json::Deserializer::from_slice(&body); match serde_ignored::deserialize(deserializer, |path| { warn!("Ignoring unknown field in body: {}", path); unused_elements.push(path.to_string()); @@ -732,7 +732,7 @@ impl hyper::service::Service<(Request, C)> for Service where hyper::Method::PUT if path.matched(paths::ID_FAKE_BODY_WITH_QUERY_PARAMS) => { // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) let query_params = form_urlencoded::parse(uri.query().unwrap_or_default().as_bytes()).collect::>(); - let param_query = query_params.iter().filter(|e| e.0 == "query").map(|e| e.1.to_owned()) + let param_query = query_params.iter().filter(|e| e.0 == "query").map(|e| e.1.clone()) .next(); let param_query = match param_query { Some(param_query) => { @@ -765,7 +765,7 @@ impl hyper::service::Service<(Request, C)> for Service where Ok(body) => { let mut unused_elements = Vec::new(); let param_body: Option = if !body.is_empty() { - let deserializer = &mut serde_json::Deserializer::from_slice(&*body); + let deserializer = &mut serde_json::Deserializer::from_slice(&body); match serde_ignored::deserialize(deserializer, |path| { warn!("Ignoring unknown field in body: {}", path); unused_elements.push(path.to_string()); @@ -839,7 +839,7 @@ impl hyper::service::Service<(Request, C)> for Service where Ok(body) => { let mut unused_elements = Vec::new(); let param_body: Option = if !body.is_empty() { - let deserializer = &mut serde_json::Deserializer::from_slice(&*body); + let deserializer = &mut serde_json::Deserializer::from_slice(&body); match serde_ignored::deserialize(deserializer, |path| { warn!("Ignoring unknown field in body: {}", path); unused_elements.push(path.to_string()); @@ -1024,7 +1024,7 @@ impl hyper::service::Service<(Request, C)> for Service where // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) let query_params = form_urlencoded::parse(uri.query().unwrap_or_default().as_bytes()).collect::>(); - let param_enum_query_string_array = query_params.iter().filter(|e| e.0 == "enum_query_string_array").map(|e| e.1.to_owned()) + let param_enum_query_string_array = query_params.iter().filter(|e| e.0 == "enum_query_string_array").map(|e| e.1.clone()) .filter_map(|param_enum_query_string_array| param_enum_query_string_array.parse().ok()) .collect::>(); let param_enum_query_string_array = if !param_enum_query_string_array.is_empty() { @@ -1032,7 +1032,7 @@ impl hyper::service::Service<(Request, C)> for Service where } else { None }; - let param_enum_query_string = query_params.iter().filter(|e| e.0 == "enum_query_string").map(|e| e.1.to_owned()) + let param_enum_query_string = query_params.iter().filter(|e| e.0 == "enum_query_string").map(|e| e.1.clone()) .next(); let param_enum_query_string = match param_enum_query_string { Some(param_enum_query_string) => { @@ -1049,7 +1049,7 @@ impl hyper::service::Service<(Request, C)> for Service where }, None => None, }; - let param_enum_query_integer = query_params.iter().filter(|e| e.0 == "enum_query_integer").map(|e| e.1.to_owned()) + let param_enum_query_integer = query_params.iter().filter(|e| e.0 == "enum_query_integer").map(|e| e.1.clone()) .next(); let param_enum_query_integer = match param_enum_query_integer { Some(param_enum_query_integer) => { @@ -1066,7 +1066,7 @@ impl hyper::service::Service<(Request, C)> for Service where }, None => None, }; - let param_enum_query_double = query_params.iter().filter(|e| e.0 == "enum_query_double").map(|e| e.1.to_owned()) + let param_enum_query_double = query_params.iter().filter(|e| e.0 == "enum_query_double").map(|e| e.1.clone()) .next(); let param_enum_query_double = match param_enum_query_double { Some(param_enum_query_double) => { @@ -1135,7 +1135,7 @@ impl hyper::service::Service<(Request, C)> for Service where Ok(body) => { let mut unused_elements = Vec::new(); let param_param: Option> = if !body.is_empty() { - let deserializer = &mut serde_json::Deserializer::from_slice(&*body); + let deserializer = &mut serde_json::Deserializer::from_slice(&body); match serde_ignored::deserialize(deserializer, |path| { warn!("Ignoring unknown field in body: {}", path); unused_elements.push(path.to_string()); @@ -1253,7 +1253,7 @@ impl hyper::service::Service<(Request, C)> for Service where Ok(body) => { let mut unused_elements = Vec::new(); let param_body: Option = if !body.is_empty() { - let deserializer = &mut serde_json::Deserializer::from_slice(&*body); + let deserializer = &mut serde_json::Deserializer::from_slice(&body); match serde_ignored::deserialize(deserializer, |path| { warn!("Ignoring unknown field in body: {}", path); unused_elements.push(path.to_string()); @@ -1564,7 +1564,7 @@ impl hyper::service::Service<(Request, C)> for Service where // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) let query_params = form_urlencoded::parse(uri.query().unwrap_or_default().as_bytes()).collect::>(); - let param_status = query_params.iter().filter(|e| e.0 == "status").map(|e| e.1.to_owned()) + let param_status = query_params.iter().filter(|e| e.0 == "status").map(|e| e.1.clone()) .filter_map(|param_status| param_status.parse().ok()) .collect::>(); @@ -1641,7 +1641,7 @@ impl hyper::service::Service<(Request, C)> for Service where // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) let query_params = form_urlencoded::parse(uri.query().unwrap_or_default().as_bytes()).collect::>(); - let param_tags = query_params.iter().filter(|e| e.0 == "tags").map(|e| e.1.to_owned()) + let param_tags = query_params.iter().filter(|e| e.0 == "tags").map(|e| e.1.clone()) .filter_map(|param_tags| param_tags.parse().ok()) .collect::>(); @@ -2317,7 +2317,7 @@ impl hyper::service::Service<(Request, C)> for Service where Ok(body) => { let mut unused_elements = Vec::new(); let param_body: Option = if !body.is_empty() { - let deserializer = &mut serde_json::Deserializer::from_slice(&*body); + let deserializer = &mut serde_json::Deserializer::from_slice(&body); match serde_ignored::deserialize(deserializer, |path| { warn!("Ignoring unknown field in body: {}", path); unused_elements.push(path.to_string()); @@ -2401,7 +2401,7 @@ impl hyper::service::Service<(Request, C)> for Service where Ok(body) => { let mut unused_elements = Vec::new(); let param_body: Option = if !body.is_empty() { - let deserializer = &mut serde_json::Deserializer::from_slice(&*body); + let deserializer = &mut serde_json::Deserializer::from_slice(&body); match serde_ignored::deserialize(deserializer, |path| { warn!("Ignoring unknown field in body: {}", path); unused_elements.push(path.to_string()); @@ -2474,7 +2474,7 @@ impl hyper::service::Service<(Request, C)> for Service where Ok(body) => { let mut unused_elements = Vec::new(); let param_body: Option> = if !body.is_empty() { - let deserializer = &mut serde_json::Deserializer::from_slice(&*body); + let deserializer = &mut serde_json::Deserializer::from_slice(&body); match serde_ignored::deserialize(deserializer, |path| { warn!("Ignoring unknown field in body: {}", path); unused_elements.push(path.to_string()); @@ -2547,7 +2547,7 @@ impl hyper::service::Service<(Request, C)> for Service where Ok(body) => { let mut unused_elements = Vec::new(); let param_body: Option> = if !body.is_empty() { - let deserializer = &mut serde_json::Deserializer::from_slice(&*body); + let deserializer = &mut serde_json::Deserializer::from_slice(&body); match serde_ignored::deserialize(deserializer, |path| { warn!("Ignoring unknown field in body: {}", path); unused_elements.push(path.to_string()); @@ -2739,7 +2739,7 @@ impl hyper::service::Service<(Request, C)> for Service where hyper::Method::GET if path.matched(paths::ID_USER_LOGIN) => { // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) let query_params = form_urlencoded::parse(uri.query().unwrap_or_default().as_bytes()).collect::>(); - let param_username = query_params.iter().filter(|e| e.0 == "username").map(|e| e.1.to_owned()) + let param_username = query_params.iter().filter(|e| e.0 == "username").map(|e| e.1.clone()) .next(); let param_username = match param_username { Some(param_username) => { @@ -2763,7 +2763,7 @@ impl hyper::service::Service<(Request, C)> for Service where .body(Body::from("Missing required query parameter username")) .expect("Unable to create Bad Request response for missing query parameter username")), }; - let param_password = query_params.iter().filter(|e| e.0 == "password").map(|e| e.1.to_owned()) + let param_password = query_params.iter().filter(|e| e.0 == "password").map(|e| e.1.clone()) .next(); let param_password = match param_password { Some(param_password) => { @@ -2926,7 +2926,7 @@ impl hyper::service::Service<(Request, C)> for Service where Ok(body) => { let mut unused_elements = Vec::new(); let param_body: Option = if !body.is_empty() { - let deserializer = &mut serde_json::Deserializer::from_slice(&*body); + let deserializer = &mut serde_json::Deserializer::from_slice(&body); match serde_ignored::deserialize(deserializer, |path| { warn!("Ignoring unknown field in body: {}", path); unused_elements.push(path.to_string()); diff --git a/samples/server/petstore/rust-server/output/ping-bearer-auth/src/lib.rs b/samples/server/petstore/rust-server/output/ping-bearer-auth/src/lib.rs index 5a5c46ba33cc..aa43ad0d5974 100644 --- a/samples/server/petstore/rust-server/output/ping-bearer-auth/src/lib.rs +++ b/samples/server/petstore/rust-server/output/ping-bearer-auth/src/lib.rs @@ -1,6 +1,6 @@ #![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] #![allow(unused_imports, unused_attributes)] -#![allow(clippy::derive_partial_eq_without_eq, clippy::blacklisted_name)] +#![allow(clippy::derive_partial_eq_without_eq, clippy::disallowed_names)] use async_trait::async_trait; use futures::Stream; diff --git a/samples/server/petstore/rust-server/output/rust-server-test/src/lib.rs b/samples/server/petstore/rust-server/output/rust-server-test/src/lib.rs index 9d9c1f711c32..01365afbb0fa 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/src/lib.rs +++ b/samples/server/petstore/rust-server/output/rust-server-test/src/lib.rs @@ -1,6 +1,6 @@ #![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] #![allow(unused_imports, unused_attributes)] -#![allow(clippy::derive_partial_eq_without_eq, clippy::blacklisted_name)] +#![allow(clippy::derive_partial_eq_without_eq, clippy::disallowed_names)] use async_trait::async_trait; use futures::Stream; diff --git a/samples/server/petstore/rust-server/output/rust-server-test/src/server/mod.rs b/samples/server/petstore/rust-server/output/rust-server-test/src/server/mod.rs index 52df96f3ef60..4789b886ecde 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/src/server/mod.rs +++ b/samples/server/petstore/rust-server/output/rust-server-test/src/server/mod.rs @@ -236,7 +236,7 @@ impl hyper::service::Service<(Request, C)> for Service where Ok(body) => { let mut unused_elements = Vec::new(); let param_nested_response: Option = if !body.is_empty() { - let deserializer = &mut serde_json::Deserializer::from_slice(&*body); + let deserializer = &mut serde_json::Deserializer::from_slice(&body); match serde_ignored::deserialize(deserializer, |path| { warn!("Ignoring unknown field in body: {}", path); unused_elements.push(path.to_string()); @@ -546,7 +546,7 @@ impl hyper::service::Service<(Request, C)> for Service where Ok(body) => { let mut unused_elements = Vec::new(); let param_value: Option = if !body.is_empty() { - let deserializer = &mut serde_json::Deserializer::from_slice(&*body); + let deserializer = &mut serde_json::Deserializer::from_slice(&body); match serde_ignored::deserialize(deserializer, |path| { warn!("Ignoring unknown field in body: {}", path); unused_elements.push(path.to_string());