QM64L3XOUB74M2D7TXDJWXGJNQN46IMF22Y24VNFQ5FEWODLVBLAC
NEBSVXIASWSJO2CVU3VWRONIWJJDLL3VDS6WNKQBWQBRUUI7RSYAC
WWDZWJTRJWSLVFMQFHS7JMDPK5VNDIQ6IHSMES7BVKYHZY6WRYKAC
LU6IFZFGPIKF3CBWZWITWVBSCYWF7Q4UXJDXVRWZ4XV7PKE5RSTQC
QJC4IQITOQP65AFLA5CMH2EXHB6B3SOLW2XBV72U5ZQU2KOR2EIAC
C6W7N6N57UCNHEV55HEZ3G7WN2ZOBGMFBB5M5ZPDB2HNNHHTOPBQC
7M4UI3TWQIAA333GQ577HDWDWZPSZKWCYG556L6SBRLB6SZDQYPAC
HHJDRLLNN36UNIA7STAXEEVBCEMPJNB7SJQOS3TJLLYN4AEZ4MHQC
JUV7C6ET4ZQJNLO7B4JB7XMLV2YUBZB4ARJHN4JEPHDGGBWGLEVAC
VZYZRAO4EXCHW2LBVFG5ELSWG5SCNDREMJ6RKQ4EKQGI2T7SD3ZQC
VQBJBFEXRTJDBH27SVWRBCBFC7OOFOZ3DSMX7PE5BIZQLGHPVDYAC
UKFEFT6LSI4K7X6UHQFZYD52DILKXMZMYSO2UYS2FCHNPXIF4BEQC
LYZBTYIWMOD3YTMOTBJBRNVYR7JOKVVGSHCFALKLGJO3IXTJC6HQC
#[duplicate_item(
type_name;
[String];
[&str];
[Box<str>];
[Cow<'_, str>];
)]
impl Localize for type_name {
const CANONICAL_LOCALE: LanguageIdentifier = langid!("en-US");
macro_rules! impl_string {
($string_type:ty) => {
impl Localize for $string_type {
const CANONICAL_LOCALE: LanguageIdentifier = langid!("en-US");
fn available_locales(&self) -> Vec<LanguageIdentifier> {
// TODO: keep track of all locales with Fluent data, and return only those
vec![Self::CANONICAL_LOCALE]
}
fn available_locales(&self) -> Vec<LanguageIdentifier> {
// TODO: keep track of all locales with Fluent data, and return only those
vec![Self::CANONICAL_LOCALE]
}
fn message_for_locale(&self, _locale: &LanguageIdentifier) -> String {
(*self).to_string()
}
fn message_for_locale(&self, _locale: &LanguageIdentifier) -> String {
(*self).to_string()
}
}
};
impl_string!(String);
impl_string!(&str);
impl_string!(Box<str>);
impl_string!(Cow<'_, str>);
use icu_decimal::{options::DecimalFormatterOptions, DecimalFormatter};
use icu_locale::{langid, LanguageIdentifier};
use icu_decimal::{DecimalFormatter, options::DecimalFormatterOptions};
use icu_locale::{LanguageIdentifier, langid};
macro_rules! impl_integer {
($numeric_type:ty) => {
impl Localize for $numeric_type {
const CANONICAL_LOCALE: LanguageIdentifier = langid!("en-US");
fn available_locales(&self) -> Vec<LanguageIdentifier> {
// TODO: keep track of all locales with Fluent data, and return only those
vec![Self::CANONICAL_LOCALE]
}
// Implementations of `Localize` for all primitive number types
// These just convert to a `Decimal` and then use its implementation
#[duplicate_item(
type_name conversion;
[u8] [Decimal::from(*self)];
[u16] [Decimal::from(*self)];
[u32] [Decimal::from(*self)];
[u64] [Decimal::from(*self)];
[u128] [Decimal::from(*self)];
[usize] [Decimal::from(*self)];
[i8] [Decimal::from(*self)];
[i16] [Decimal::from(*self)];
[i32] [Decimal::from(*self)];
[i64] [Decimal::from(*self)];
[i128] [Decimal::from(*self)];
[isize] [Decimal::from(*self)];
fn message_for_locale(&self, locale: &LanguageIdentifier) -> String {
let fixed_decimal = Decimal::from(*self);
fixed_decimal.message_for_locale(locale)
}
}
};
}
[f32] [Decimal::try_from_f64(f64::from(*self), FloatPrecision::RoundTrip).unwrap()];
[f64] [Decimal::try_from_f64(*self, FloatPrecision::RoundTrip).unwrap()];
)]
impl Localize for type_name {
const CANONICAL_LOCALE: LanguageIdentifier = langid!("en-US");
macro_rules! impl_float {
($numeric_type:ty) => {
impl Localize for $numeric_type {
const CANONICAL_LOCALE: LanguageIdentifier = langid!("en-US");
fn available_locales(&self) -> Vec<LanguageIdentifier> {
// TODO: keep track of all locales with Fluent data, and return only those
vec![Self::CANONICAL_LOCALE]
}
fn available_locales(&self) -> Vec<LanguageIdentifier> {
// TODO: keep track of all locales with Fluent data, and return only those
vec![Self::CANONICAL_LOCALE]
}
fn message_for_locale(
&self,
locale: &LanguageIdentifier,
) -> String {
let fixed_decimal = conversion;
fixed_decimal.message_for_locale(locale)
}
fn message_for_locale(&self, locale: &LanguageIdentifier) -> String {
let fixed_decimal =
Decimal::try_from_f64(f64::from(*self), FloatPrecision::RoundTrip).unwrap();
fixed_decimal.message_for_locale(locale)
}
}
};
fn message_for_locale(
&self,
locale: &LanguageIdentifier,
) -> String {
fn message_for_locale(&self, locale: &LanguageIdentifier) -> String {
name = "proc-macro2-diagnostics"
version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8"
dependencies = [
"proc-macro2",
"quote",
"syn",
"version_check",
"yansi",
]
[[package]]