Skip to content

Comments

Fix #473: add explicit serde feature that is independent from dependency#524

Merged
Mingun merged 1 commit intotafia:masterfrom
Mingun:serde
Dec 21, 2022
Merged

Fix #473: add explicit serde feature that is independent from dependency#524
Mingun merged 1 commit intotafia:masterfrom
Mingun:serde

Conversation

@Mingun
Copy link
Collaborator

@Mingun Mingun commented Dec 12, 2022

This should fix #473. @loyd, @xkr47, can you check?

Checked by

cargo init
cargo add quick-xml --features serialize --path path/to/local/copy/of/quick-xml
cargo check

(failed without --path with the fix)

@Mingun Mingun added the serde Issues related to mapping from Rust types to XML label Dec 12, 2022
@Mingun Mingun requested a review from dralley December 12, 2022 15:08
Copy link

@xkr47 xkr47 left a comment

Choose a reason for hiding this comment

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

This works for me, including the comment I posted here: #473 (comment)

## This feature does NOT provide XML serializer or deserializer. You should use
## the `serialize` feature for that instead.
# Cannot name "serde" to avoid clash with dependency.
# "dep:" prefix only avalible from Rust 1.60
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this mean that with edition 2021 / MSRV 1.60, it is possible to simplify all of this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, in Rust 1.60 it is possible to write

[dependencies]
serde = { version = "1.0", optional = true }

[features]
# depend on the dependency "serde" instead of feature "serde"
# (which will enable "derive" feature of "serde" which is not required
# for the "serialize" feature)
serialize = ["dep:serde"] 

# depend on "serde" dependency with enabled feature "derive"
serde = ["serde/derive"]

Copy link
Collaborator

Choose a reason for hiding this comment

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

If we don't want to bump the MSRV right now then we should file an issue to simplify this in the future. I wouldn't be against bumping MSRV though.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You can create an issue if you wish. Anyway, I marked this place with Rust version that is required for more modern solution, so it can be grepped.

I think, this that having more modern solution is not critical, so it is better to avoid bumping MSRV just for it. Otherwise, probably some of our dependents will not happy with that.

@Mingun Mingun merged commit 44a4c69 into tafia:master Dec 21, 2022
@Mingun Mingun deleted the serde branch December 21, 2022 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

serde Issues related to mapping from Rust types to XML

Projects

None yet

Development

Successfully merging this pull request may close these issues.

quick-xml requires implicitly enabled serde/derive

3 participants