-
Notifications
You must be signed in to change notification settings - Fork 32
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 chained fallback support and performance improved #69
Conversation
Example: i18n!("locales", fallback = ["en", "es]);
* Use AtomicStr instead of RwLock<String> * Change locale() return type to Arc<String>
|
Update this new benchmark result to t time: [58.274 ns 60.222 ns 62.390 ns]
t_with_locale time: [55.395 ns 57.106 ns 59.081 ns]
t_with_args time: [167.46 ns 170.94 ns 175.64 ns]
t_with_args (str) time: [164.85 ns 165.91 ns 167.41 ns]
t_with_args (many) time: [444.04 ns 452.17 ns 463.44 ns]
t_with_threads time: [414.26 ns 422.97 ns 433.53 ns] |
The AtomicPtr
|
New:
i18n!("locales", fallback = ["en", "es]);
Improved:
RwLock
fromlocale()
andset_locale()
.t!()
.Breaking Changes:
rust_i18n::locale() -> String
=>rust_i18n::locale() -> Arc<String>
.t!() -> String
=>t!() -> Cow<str>
.