Repository navigation
Conversation
Users of a concurrent FluentBundle currently have to add the intl-memoizer crate as a direct dependency just to name the bundle type. Re-export intl_memoizer::concurrent::IntlLangMemoizer from the umbrella fluent crate so the full type can be spelled as fluent::bundle::FluentBundle<FluentResource, fluent::IntlLangMemoizer>. The re-export is documented with a doctest covering the concurrent bundle type. LanguageIdentifier is intentionally not re-exported, as discussed in projectfluent#256. Refs projectfluent#256
Author
|
Gentle ping on this one — it re-exports |
Author
|
Hi — gentle ping. This re-export follows the maintainer guidance in #256 (IntlLangMemoizer only); happy to adjust if anything else is needed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this change?
Re-exports
intl_memoizer::concurrent::IntlLangMemoizerfrom thefluentumbrella crate:Users of a concurrent
FluentBundlecurrently have to add theintl-memoizercrate as a direct dependency just to name the bundle type (see #256). With this change the full type can be spelled using only thefluentcrate, while the re-export is the same type thatfluent_bundle::concurrent::FluentBundleis built on.As discussed in #256, only
IntlLangMemoizeris re-exported here —LanguageIdentifieris left out, since it also appears throughunic-langid/fluent-langnegand there was no consensus on re-exporting it.Refs #256.
Changes
fluent/Cargo.toml: addintl-memoizer(already a workspace dependency, and already a transitive dependency throughfluent-bundle, so no extra build cost).fluent/src/lib.rs:pub use intl_memoizer::concurrent::IntlLangMemoizer;with rustdoc and a doctest that constructs a concurrent bundle and passes it to a function taking the full type.Verification
Ran locally with Rust 1.99.1:
cargo build -p fluent→Finished dev profile ... in 18.01scargo test -p fluent→3 passed; 0 failed(includes the new doctest)cargo test -p fluent --all-features→3 passed; 0 failedcargo clippy -p fluent --all-features -- -Dwarnings→ no warnings (CI runs this across the workspace)cargo fmt --check→ clean (CI runs rustfmt with nightly)No behaviour changes; this is a public API addition only.