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

fix: feature-gated imports #110

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

itsyaasir
Copy link
Collaborator

  • Update cached dependency to version 0.52
  • Refactor client code to conditionally include openssl-related imports based on feature flags
  • Move Invoice and InvoiceItem structs to bill_manager module

* Update cached dependency to version 0.52
* Refactor client code to conditionally include openssl-related imports based on feature flags
* Move Invoice and InvoiceItem structs to bill_manager module
@itsyaasir
Copy link
Collaborator Author

The code is starting to look ugly with all the feature gated things! we should come up with a way to clean this up.

@itsyaasir itsyaasir requested a review from c12i July 8, 2024 15:32
@itsyaasir itsyaasir marked this pull request as ready for review July 8, 2024 15:32
Copy link
Owner

@c12i c12i left a comment

Choose a reason for hiding this comment

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

A macro could be useful with the repetition to some extent

Doc tests need to be looked at separately, it's been a while.

Comment on lines +5 to 28
#[cfg(any(
feature = "account_balance",
feature = "b2b",
feature = "b2c",
feature = "transaction_reversal",
feature = "transaction_status"
))]
use openssl::base64;
#[cfg(any(
feature = "account_balance",
feature = "b2b",
feature = "b2c",
feature = "transaction_reversal",
feature = "transaction_status"
))]
use openssl::rsa::Padding;
#[cfg(any(
feature = "account_balance",
feature = "b2b",
feature = "b2c",
feature = "transaction_reversal",
feature = "transaction_status"
))]
use openssl::x509::X509;
Copy link
Owner

Choose a reason for hiding this comment

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

This could be possible cleaned up by deriving a feature_locked! (better name needed) declarative macro

Comment on lines +315 to +321
#[cfg(any(
feature = "account_balance",
feature = "b2b",
feature = "b2c",
feature = "transaction_reversal",
feature = "transaction_status"
))]
Copy link
Owner

Choose a reason for hiding this comment

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

same for this


#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct Invoice<'i> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ahh, I see you've moved this from the constants module to the bill manager module. This works as I don't think any other API (apart from bill manager) uses the invoice construct 👍

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.

3 participants