feat(data): add runtime currency data lookup behind data feature flag#14
Conversation
Agent-Logs-Url: https://github.com/mfirhas/currencylib/sessions/a47e248a-7314-48cc-94db-a57e309ecad9 Co-authored-by: mfirhas <11944811+mfirhas@users.noreply.github.com>
data feature flag
|
@copilot Why don't we use |
The current approach is preferable for a few reasons:
No changes made. |
|
@copilot I want to confirm. The |
Yes, confirmed.
|
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment Thanks for integrating Codecov - We've got you covered ☂️ |
Exposes the compile-time
ISO_CURRENCY_DATAPHF map at runtime via a new opt-indatafeature, enabling users to query currency metadata dynamically by ISO 4217 code.Changes
Cargo.toml: Addeddatafeature gating optionalphfdependency;phfremains a build-dep for codegendata.rs→src/data.rs: Moved to standardsrc/layout; addedget(code: &str) -> Option<Data>functionbuild.rs: Updatedmod datawith#[path = "src/data.rs"]to reflect new locationsrc/lib.rs: Conditionally includespub mod dataunder#[cfg(feature = "data")]src/data_test.rs: Tests forget()— known codes, unknown codes, case sensitivity, direct map accessUsage