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

add #![cfg(any(feature ...))], to reduce warning in cargo test #2177

Merged
merged 1 commit into from
Apr 17, 2024

Conversation

Hmikihiro
Copy link
Contributor

Changes

  • I add #![cfg()]to the beginning of files that have #[sea_orm_macros::test] macros.

When I run cargo test, Cl makes many warning such as unused_import. Those imports were compiled all time, but test function is compiled when future have "sqlx- ...".
#[sea_orm_macros::test] attributes is expand to #[cfg(any( feature = "sqlx-mysql", feature = "sqlx-sqlite", feature = "sqlx-postgres" ))]. So, I think that to reduce cargo test warnings, conditional compilation with the same condition that #[sea_orm_macros::test] is needed for each file.

@Hmikihiro Hmikihiro changed the title @add #![cfg(any(feature ...))], to reduce warning in cargo test add #![cfg(any(feature ...))], to reduce warning in cargo test Mar 28, 2024
Copy link
Member

@tyt2y3 tyt2y3 left a comment

Choose a reason for hiding this comment

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

Thanks!

@tyt2y3 tyt2y3 merged commit a069d46 into SeaQL:master Apr 17, 2024
32 checks passed
Copy link

github-actions bot commented May 3, 2024

🎉 Released In 1.0.0-rc.4 🎉

Thank you everyone for the contribution!
This feature is now available in the latest release. Now is a good time to upgrade!
Your participation is what makes us unique; your adoption is what drives us forward.
You can support SeaQL 🌊 by starring our repos, sharing our libraries and becoming a sponsor ⭐.

Copy link

github-actions bot commented Aug 4, 2024

🎉 Released In 1.0.0 🎉

Thank you everyone for the contribution!
This feature is now available in the latest release. Now is a good time to upgrade!
Your participation is what makes us unique; your adoption is what drives us forward.
You can support SeaQL 🌊 by starring our repos, sharing our libraries and becoming a sponsor ⭐.

@Hmikihiro Hmikihiro deleted the add-cfg-feature branch August 18, 2024 14:09
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.

2 participants