Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump Rust edition to 2021 and a few crates #18608

Merged

Conversation

maxnachlinger
Copy link
Contributor

@maxnachlinger maxnachlinger commented May 8, 2024

Bump Rust edition to 2021 and a few crates. Fixes: #18609

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    ./mvnw clean package 
    ./bin/generate-samples.sh ./bin/configs/*.yaml
    ./bin/utils/export_docs_generators.sh
    
    (For Windows users, please run the script in Git BASH)
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
  • File the PR against the correct branch: master (upcoming 7.1.0 minor release - breaking changes with fallbacks), 8.0.x (breaking changes without fallbacks)
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request. @frol (2017/07) @farcaller (2017/08) @richardwhiuk (2019/07) @paladinzh (2020/05) @jacob-pro (2022/10)

@@ -38,8 +38,8 @@ serde_derive = "^1.0"
serde_with = { version = "^3", default-features = false, features = ["base64", "std", "macros"] }
{{/serdeWith}}
serde_json = "^1.0"
url = "^2.2"
uuid = { version = "^1.0", features = ["serde", "v4"] }
url = "^2.5"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

url = "^2.2"
uuid = { version = "^1.0", features = ["serde", "v4"] }
url = "^2.5"
uuid = { version = "^1.8", features = ["serde", "v4"] }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

features = ["json", "blocking", "multipart"]
{{/supportAsync}}
{{#supportAsync}}
{{#supportMiddleware}}
reqwest-middleware = "0.2.0"
reqwest-middleware = "0.3.1"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wing328
Copy link
Member

wing328 commented May 8, 2024

thanks for the PR. can you please take a look at https://github.com/OpenAPITools/openapi-generator/actions/runs/9002489911/job/24730910208?pr=18608 when you've time?

@maxnachlinger
Copy link
Contributor Author

@wing328 - I opened this PR too quickly, sorry for the churn. Fixing the build now :(

@wing328
Copy link
Member

wing328 commented May 8, 2024

Please take our time. Appreciate the PR to bump the dependencies to newer versions.

If you need help, let me know. (ping me via Slack)

@maxnachlinger maxnachlinger marked this pull request as draft May 8, 2024 14:03
@maxnachlinger maxnachlinger force-pushed the chore-bump-edition-and-crates branch from d524d27 to da88754 Compare May 8, 2024 14:36
@@ -32,14 +32,13 @@ homepage = "{{.}}
{{/homePageUrl}}

[dependencies]
serde = "^1.0"
serde_derive = "^1.0"
serde = { version = "^1.0", features = ["derive"] }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using serde with the derive feature instead of serde_derive

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: serde_derive hasn't been required in years at this point :) Even the serde docs show using the derive feature: https://serde.rs/derive.html#using-derive

features = ["json", "blocking", "multipart"]
reqwest = { version = "^0.12", features = ["json", "blocking", "multipart"] }
{{#supportMiddleware}}
reqwest-middleware = { version = "^0.3", features = ["json", "blocking", "multipart"] }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reqwest-middleware requires the same features as reqwest

@@ -29,19 +29,19 @@ impl From<(hyper::StatusCode, hyper::body::Body)> for Error {

impl From<http::Error> for Error {
fn from(e: http::Error) -> Self {
return Error::Http(e)
Error::Http(e)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to return

@maxnachlinger maxnachlinger marked this pull request as ready for review May 8, 2024 15:04
@maxnachlinger
Copy link
Contributor Author

@wing328 - PR is ready for a review

[dependencies.reqwest]
version = "^0.11"
features = ["json", "blocking", "multipart"]
reqwest = { version = "^0.12", features = ["json", "blocking", "multipart"] }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -174,7 +174,7 @@ pub {{#supportAsync}}async {{/supportAsync}}fn {{{operationId}}}(configuration:
{{/bodyParams}}
{{/hasBodyParam}}
{{^hasBodyParam}}
&"",
"",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clippy to the rescue :)

@wing328
Copy link
Member

wing328 commented May 9, 2024

lgtm. thanks for the PR.

@wing328 wing328 merged commit 03389df into OpenAPITools:master May 9, 2024
18 checks passed
@maxnachlinger maxnachlinger deleted the chore-bump-edition-and-crates branch May 9, 2024 23:40
renatomameli pushed a commit to renatomameli/openapi-generator that referenced this pull request May 17, 2024
* bump Rust edition to 2021, update a few creates

* bump Rust edition to 2021, update a few creates
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[REQ] Bump Rust edition to 2021 and a few crates
2 participants