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

Update to rust edition 2021 #294

Merged
merged 3 commits into from
Jul 31, 2022
Merged

Conversation

ramsayleung
Copy link
Owner

Description

Update to Rust edition 202

Motivation and Context

Trying to close #275, by the way, as for this:

Try removing the build_map and build_json macros now that HashMap::from([(a,b), (c,d)]) is possible (only in case it looks great).

I think it's necessary to keep build_json and build_map macros, since the current optional semantics can't be replaced with the built-in HashMap::from method:

        let params = build_map! {
            optional "album_type": album_type.map(|x| x.as_ref()),
            optional "market": market.map(|x| x.as_ref()),
            optional "limit": limit.as_deref(),
            optional "offset": offset.as_deref(),
        };

Dependencies

None

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How has this been tested?

All CI checks should pass

Is this change properly documented?

I think it's not necessary to add this to CHANGELOG

Last but not least, Merry Christmas :-)

@marioortizmanero
Copy link
Collaborator

You forgot to edit the edition for the rest of the crates. We should probably add rust-version = "1.56" to the Cargo.toml while we're at it. And remove resolver = "2", since that's default now.

I think it's necessary to keep build_json and build_map macros, since the current optional semantics can't be replaced with the built-in HashMap::from method:

Oh, you're right, I completely forgot about that. Yeah, I'd rather keep the macros in that case.

Anyway, it might be better to wait a bit more, maybe until 1.58 is released?

Merry Christmas, Ramsay!

@ramsayleung
Copy link
Owner Author

You forgot to edit the edition for the rest of the crates. We should probably add rust-version = "1.56" to the Cargo.toml while we're at it. And remove resolver = "2", since that's default now.

Good point!

Anyway, it might be better to wait a bit more, maybe until 1.58 is released?

Sure, we could wait for 1.58

@marioortizmanero
Copy link
Collaborator

It's time to merge this for the next version :)

@marioortizmanero marioortizmanero merged commit ccd44c8 into master Jul 31, 2022
@marioortizmanero marioortizmanero deleted the ramsay_update_to_rust2021 branch July 31, 2022 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use Rust edition 2021
2 participants