Skip to content

Commit

Permalink
[Rust Server] Convert Rust comment to Mustache (#19595)
Browse files Browse the repository at this point in the history
* [Rust Server] Convert Rust comment to Mustache

The comment about auth types supported by the generator shouldn't be
included in the generated code as it's confusing when the API doesn't
support the same auth types.

As such, we convert it from a Rust comment to a Mustache comment

* Update samples
  • Loading branch information
richardwhiuk authored Sep 18, 2024
1 parent 0b084cd commit cf5d17b
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
{{#hasAuthMethods}}
#[allow(clippy::collapsible_match)]
if let Some(auth_data) = Has::<Option<AuthData>>::get(context).as_ref() {
// Currently only authentication with Basic and Bearer are supported
{{! Currently only authentication with Basic and Bearer are supported }}
#[allow(clippy::single_match, clippy::match_single_binding)]
match auth_data {
{{#authMethods}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1191,7 +1191,6 @@ impl<S, C> Api<C> for Client<S, C> where

#[allow(clippy::collapsible_match)]
if let Some(auth_data) = Has::<Option<AuthData>>::get(context).as_ref() {
// Currently only authentication with Basic and Bearer are supported
#[allow(clippy::single_match, clippy::match_single_binding)]
match auth_data {
AuthData::Bearer(bearer_header) => {
Expand Down Expand Up @@ -1519,7 +1518,6 @@ impl<S, C> Api<C> for Client<S, C> where

#[allow(clippy::collapsible_match)]
if let Some(auth_data) = Has::<Option<AuthData>>::get(context).as_ref() {
// Currently only authentication with Basic and Bearer are supported
#[allow(clippy::single_match, clippy::match_single_binding)]
match auth_data {
AuthData::Bearer(bearer_header) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1272,7 +1272,6 @@ impl<S, C> Api<C> for Client<S, C> where

#[allow(clippy::collapsible_match)]
if let Some(auth_data) = Has::<Option<AuthData>>::get(context).as_ref() {
// Currently only authentication with Basic and Bearer are supported
#[allow(clippy::single_match, clippy::match_single_binding)]
match auth_data {
AuthData::Basic(basic_header) => {
Expand Down Expand Up @@ -1759,7 +1758,6 @@ impl<S, C> Api<C> for Client<S, C> where

#[allow(clippy::collapsible_match)]
if let Some(auth_data) = Has::<Option<AuthData>>::get(context).as_ref() {
// Currently only authentication with Basic and Bearer are supported
#[allow(clippy::single_match, clippy::match_single_binding)]
match auth_data {
_ => {}
Expand Down Expand Up @@ -1859,7 +1857,6 @@ impl<S, C> Api<C> for Client<S, C> where

#[allow(clippy::collapsible_match)]
if let Some(auth_data) = Has::<Option<AuthData>>::get(context).as_ref() {
// Currently only authentication with Basic and Bearer are supported
#[allow(clippy::single_match, clippy::match_single_binding)]
match auth_data {
AuthData::Bearer(bearer_header) => {
Expand Down Expand Up @@ -1949,7 +1946,6 @@ impl<S, C> Api<C> for Client<S, C> where

#[allow(clippy::collapsible_match)]
if let Some(auth_data) = Has::<Option<AuthData>>::get(context).as_ref() {
// Currently only authentication with Basic and Bearer are supported
#[allow(clippy::single_match, clippy::match_single_binding)]
match auth_data {
AuthData::Bearer(bearer_header) => {
Expand Down Expand Up @@ -2057,7 +2053,6 @@ impl<S, C> Api<C> for Client<S, C> where

#[allow(clippy::collapsible_match)]
if let Some(auth_data) = Has::<Option<AuthData>>::get(context).as_ref() {
// Currently only authentication with Basic and Bearer are supported
#[allow(clippy::single_match, clippy::match_single_binding)]
match auth_data {
AuthData::Bearer(bearer_header) => {
Expand Down Expand Up @@ -2174,7 +2169,6 @@ impl<S, C> Api<C> for Client<S, C> where

#[allow(clippy::collapsible_match)]
if let Some(auth_data) = Has::<Option<AuthData>>::get(context).as_ref() {
// Currently only authentication with Basic and Bearer are supported
#[allow(clippy::single_match, clippy::match_single_binding)]
match auth_data {
AuthData::Bearer(bearer_header) => {
Expand Down Expand Up @@ -2274,7 +2268,6 @@ impl<S, C> Api<C> for Client<S, C> where

#[allow(clippy::collapsible_match)]
if let Some(auth_data) = Has::<Option<AuthData>>::get(context).as_ref() {
// Currently only authentication with Basic and Bearer are supported
#[allow(clippy::single_match, clippy::match_single_binding)]
match auth_data {
AuthData::Bearer(bearer_header) => {
Expand Down Expand Up @@ -2381,7 +2374,6 @@ impl<S, C> Api<C> for Client<S, C> where

#[allow(clippy::collapsible_match)]
if let Some(auth_data) = Has::<Option<AuthData>>::get(context).as_ref() {
// Currently only authentication with Basic and Bearer are supported
#[allow(clippy::single_match, clippy::match_single_binding)]
match auth_data {
_ => {}
Expand Down Expand Up @@ -2500,7 +2492,6 @@ impl<S, C> Api<C> for Client<S, C> where

#[allow(clippy::collapsible_match)]
if let Some(auth_data) = Has::<Option<AuthData>>::get(context).as_ref() {
// Currently only authentication with Basic and Bearer are supported
#[allow(clippy::single_match, clippy::match_single_binding)]
match auth_data {
AuthData::Bearer(bearer_header) => {
Expand Down Expand Up @@ -2648,7 +2639,6 @@ impl<S, C> Api<C> for Client<S, C> where

#[allow(clippy::collapsible_match)]
if let Some(auth_data) = Has::<Option<AuthData>>::get(context).as_ref() {
// Currently only authentication with Basic and Bearer are supported
#[allow(clippy::single_match, clippy::match_single_binding)]
match auth_data {
AuthData::Bearer(bearer_header) => {
Expand Down Expand Up @@ -2746,7 +2736,6 @@ impl<S, C> Api<C> for Client<S, C> where

#[allow(clippy::collapsible_match)]
if let Some(auth_data) = Has::<Option<AuthData>>::get(context).as_ref() {
// Currently only authentication with Basic and Bearer are supported
#[allow(clippy::single_match, clippy::match_single_binding)]
match auth_data {
_ => {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,6 @@ impl<S, C> Api<C> for Client<S, C> where

#[allow(clippy::collapsible_match)]
if let Some(auth_data) = Has::<Option<AuthData>>::get(context).as_ref() {
// Currently only authentication with Basic and Bearer are supported
#[allow(clippy::single_match, clippy::match_single_binding)]
match auth_data {
AuthData::Bearer(bearer_header) => {
Expand Down

0 comments on commit cf5d17b

Please sign in to comment.