diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 00000000..4a6a1abd --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,2 @@ +[resolver] +incompatible-rust-versions = "fallback" diff --git a/Cargo.toml b/Cargo.toml index 883ad909..677ceed5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,14 +36,37 @@ fluent-langneg = "0.13" futures = "0.3" iai = "0.1" intl_pluralrules = "7.0" +once_cell = "1.21" rustc-hash = "2" serde = "1.0" serde_json = "1.0" thiserror = "2.0" -tokio = "1.0" +tokio = "1.38" unic-langid = "0.9" fluent-bundle = { version = "0.15.3", path = "fluent-bundle" } fluent-fallback = { version = "0.7.1", path = "fluent-fallback" } fluent-pseudo = { version = "0.3.2", path = "fluent-pseudo" } fluent-syntax = { version = "0.11.1", path = "fluent-syntax" } +intl-memoizer = { version = "0.5.2", path = "intl-memoizer" } + +[workspace.metadata.typos.default] +locale = "en-us" +extend-ignore-re = [ + "(?s)(#|//|/\\*)\\s*typos: ignore start.*?\\n\\s*(#|//|/\\*)\\s*typos: ignore end", +] + +[workspace.metadata.typos.default.extend-words] +travelled = "travelled" # sadly part of a public API and fixing would be a breaking change +nd = "nd" # appears frequently in inline test messages + +[workspace.metadata.typos.files] +ignore-hidden = false +extend-exclude = [ + "/.git", + "fluent-bundle/benches/**/*.ftl", + "fluent-bundle/examples/**/*.ftl", + "fluent-syntax/tests/fixtures/**/*.ftl", + "fluent-syntax/tests/fixtures/**/*.json", + "fluent-testing/resources/**/*.ftl", +] diff --git a/fluent-bundle/CHANGELOG.md b/fluent-bundle/CHANGELOG.md index cf626d7d..4e25f1cc 100644 --- a/fluent-bundle/CHANGELOG.md +++ b/fluent-bundle/CHANGELOG.md @@ -1,7 +1,14 @@ # Changelog ## Unreleased - - Bump `self_cell` to 1.x + - Implement NUMBER builtin + - Improve examples + - Refactor to remove unnecessary named lifetimes + - Cleanup docs + - Satiate Clippy + - Bump `smallvec` to 1.13 + - Bump `rand` to 0.9 + - Bump `self_cell` to 1.2 - Bump `serde_yaml` to 0.9 ## fluent-bundle 0.15.3 (March 16, 2024) diff --git a/fluent-bundle/Cargo.toml b/fluent-bundle/Cargo.toml index 02c72737..75fcaef5 100644 --- a/fluent-bundle/Cargo.toml +++ b/fluent-bundle/Cargo.toml @@ -29,8 +29,8 @@ fluent-syntax.workspace = true intl_pluralrules.workspace = true rustc-hash.workspace = true unic-langid.workspace = true -intl-memoizer = { version = "0.5.2", path = "../intl-memoizer" } -self_cell = "1.0" +intl-memoizer.workspace = true +self_cell = "1.2" smallvec = "1.13" [dev-dependencies] @@ -38,7 +38,7 @@ criterion.workspace = true iai.workspace = true serde = { workspace = true, features = ["derive"] } unic-langid = { workspace = true, features = ["macros"] } -rand = "0.8" +rand = "0.9" serde_yaml = "0.9" [features] diff --git a/fluent-bundle/examples/custom_type.rs b/fluent-bundle/examples/custom_type.rs index 97bc1f57..71c0f882 100644 --- a/fluent-bundle/examples/custom_type.rs +++ b/fluent-bundle/examples/custom_type.rs @@ -8,7 +8,7 @@ // // Lastly, we'll also create a new formatter which will be memoizable. // -// The type and its options are modelled after ECMA402 Intl.DateTimeFormat. +// The type and its options are modeled after ECMA402 Intl.DateTimeFormat. use intl_memoizer::Memoizable; use unic_langid::LanguageIdentifier; @@ -21,7 +21,7 @@ use fluent_bundle::{FluentArgs, FluentBundle, FluentResource, FluentValue}; // - timeStyle // // with an enum of allowed values. -#[derive(Debug, Default, PartialEq, Eq, Clone, Hash)] +#[derive(Clone, Debug, Default, Eq, Hash, PartialEq)] enum DateTimeStyleValue { Full, Long, @@ -49,7 +49,7 @@ impl From<&FluentValue<'_>> for DateTimeStyleValue { } } -#[derive(Debug, PartialEq, Eq, Default, Clone, Hash)] +#[derive(Clone, Debug, Default, Eq, Hash, PartialEq)] struct DateTimeOptions { pub date_style: DateTimeStyleValue, pub time_style: DateTimeStyleValue, @@ -84,7 +84,7 @@ impl From<&FluentArgs<'_>> for DateTimeOptions { // Our new custom type will store a value as an epoch number, // and the options. -#[derive(Debug, PartialEq, Clone)] +#[derive(Clone, Debug, PartialEq)] struct DateTime { epoch: usize, options: DateTimeOptions, diff --git a/fluent-bundle/src/errors.rs b/fluent-bundle/src/errors.rs index 58b1754b..df4af279 100644 --- a/fluent-bundle/src/errors.rs +++ b/fluent-bundle/src/errors.rs @@ -2,7 +2,7 @@ use crate::resolver::ResolverError; use fluent_syntax::parser::ParserError; use std::error::Error; -#[derive(Debug, PartialEq, Eq, Clone)] +#[derive(Clone, Debug, Eq, PartialEq)] pub enum EntryKind { Message, Term, @@ -23,7 +23,7 @@ impl std::fmt::Display for EntryKind { /// /// It contains three main types of errors that may come up /// during runtime use of the fluent-bundle crate. -#[derive(Debug, PartialEq, Eq, Clone)] +#[derive(Clone, Debug, Eq, PartialEq)] pub enum FluentError { /// An error which occurs when /// [`FluentBundle::add_resource`](crate::bundle::FluentBundle::add_resource) diff --git a/fluent-bundle/src/resolver/errors.rs b/fluent-bundle/src/resolver/errors.rs index 7606faba..dc716d98 100644 --- a/fluent-bundle/src/resolver/errors.rs +++ b/fluent-bundle/src/resolver/errors.rs @@ -4,7 +4,7 @@ use std::error::Error; /// Maps an [`InlineExpression`] into the kind of reference, with owned strings /// that identify the expression. This makes it so that the [`InlineExpression`] can /// be used to generate an error string. -#[derive(Debug, PartialEq, Eq, Clone)] +#[derive(Clone, Debug, Eq, PartialEq)] pub enum ReferenceKind { Function { id: String, @@ -49,7 +49,7 @@ where /// Errors generated during the process of resolving a fluent message into a string. /// This process takes place in the `write` method of the `WriteValue` trait. -#[derive(Debug, PartialEq, Eq, Clone)] +#[derive(Clone, Debug, Eq, PartialEq)] pub enum ResolverError { Reference(ReferenceKind), NoValue(String), diff --git a/fluent-bundle/src/types/number.rs b/fluent-bundle/src/types/number.rs index 8cdeb26e..12aac89f 100644 --- a/fluent-bundle/src/types/number.rs +++ b/fluent-bundle/src/types/number.rs @@ -8,7 +8,7 @@ use intl_pluralrules::operands::PluralOperands; use crate::args::FluentArgs; use crate::types::FluentValue; -#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)] +#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)] pub enum FluentNumberType { #[default] Cardinal, @@ -25,7 +25,7 @@ impl From<&str> for FluentNumberType { } } -#[derive(Debug, Copy, Clone, Default, Hash, PartialEq, Eq)] +#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)] pub enum FluentNumberStyle { #[default] Decimal, @@ -44,7 +44,7 @@ impl From<&str> for FluentNumberStyle { } } -#[derive(Debug, Copy, Clone, Default, Hash, PartialEq, Eq)] +#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)] pub enum FluentNumberCurrencyDisplayStyle { #[default] Symbol, @@ -63,7 +63,7 @@ impl From<&str> for FluentNumberCurrencyDisplayStyle { } } -#[derive(Debug, Clone, Hash, PartialEq, Eq)] +#[derive(Clone, Debug, Eq, Hash, PartialEq)] pub struct FluentNumberOptions { pub r#type: FluentNumberType, pub style: FluentNumberStyle, @@ -134,7 +134,7 @@ impl FluentNumberOptions { } } -#[derive(Debug, PartialEq, Clone)] +#[derive(Clone, Debug, PartialEq)] pub struct FluentNumber { pub value: f64, pub options: FluentNumberOptions, diff --git a/fluent-bundle/tests/builtins.rs b/fluent-bundle/tests/builtins.rs index 092c94ac..35fb299f 100644 --- a/fluent-bundle/tests/builtins.rs +++ b/fluent-bundle/tests/builtins.rs @@ -4,6 +4,7 @@ use fluent_syntax::ast::Pattern; #[test] fn test_builtin_number() { // 1. Create bundle + // typos: ignore start let ftl_string = String::from( r#" count = { NUMBER($num, type: "cardinal") -> @@ -17,6 +18,7 @@ order = { NUMBER($num, type: "ordinal") -> [few] {$num}rd } "#, + // typos: ignore end ); let mut bundle = FluentBundle::default(); diff --git a/fluent-bundle/tests/custom_types.rs b/fluent-bundle/tests/custom_types.rs index 5b5b66f7..594df9af 100644 --- a/fluent-bundle/tests/custom_types.rs +++ b/fluent-bundle/tests/custom_types.rs @@ -47,7 +47,7 @@ fn fluent_custom_type() { #[test] fn fluent_date_time_builtin() { - #[derive(Debug, Default, PartialEq, Clone)] + #[derive(Clone, Debug, Default, PartialEq)] enum DateTimeStyleValue { Full, Long, @@ -73,7 +73,7 @@ fn fluent_date_time_builtin() { } } - #[derive(Debug, PartialEq, Default, Clone)] + #[derive(Clone, Debug, Default, PartialEq)] struct DateTimeOptions { pub date_style: DateTimeStyleValue, pub time_style: DateTimeStyleValue, @@ -99,7 +99,7 @@ fn fluent_date_time_builtin() { } } - #[derive(Debug, PartialEq, Clone)] + #[derive(Clone, Debug, PartialEq)] struct DateTime { epoch: usize, options: DateTimeOptions, diff --git a/fluent-bundle/tests/helpers/mod.rs b/fluent-bundle/tests/helpers/mod.rs index c5e20cf0..5a4015f6 100644 --- a/fluent-bundle/tests/helpers/mod.rs +++ b/fluent-bundle/tests/helpers/mod.rs @@ -88,7 +88,7 @@ pub fn get_defaults(path: &str) -> Result { Ok(serde_yaml::from_str(&s).expect("Parsing YAML failed.")) } -#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)] +#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)] #[serde(deny_unknown_fields)] pub struct TestBundle { pub name: Option, @@ -102,7 +102,7 @@ pub struct TestBundle { pub errors: Vec, } -#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)] +#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)] #[serde(deny_unknown_fields)] pub struct TestResource { pub name: Option, @@ -111,7 +111,7 @@ pub struct TestResource { pub source: String, } -#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)] +#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)] #[serde(deny_unknown_fields)] pub struct TestSetup { #[serde(skip_serializing_if = "Vec::is_empty", default)] @@ -120,7 +120,7 @@ pub struct TestSetup { pub resources: Vec, } -#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)] +#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)] #[serde(deny_unknown_fields)] pub struct TestError { #[serde(rename = "type")] @@ -128,7 +128,7 @@ pub struct TestError { pub desc: Option, } -#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)] +#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)] #[serde(deny_unknown_fields)] #[serde(untagged)] pub enum TestArgumentValue { @@ -136,7 +136,7 @@ pub enum TestArgumentValue { Number(f64), } -#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)] +#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)] #[serde(deny_unknown_fields)] pub struct TestAssert { pub bundle: Option, @@ -149,7 +149,7 @@ pub struct TestAssert { pub missing: Option, } -#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)] +#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)] #[serde(deny_unknown_fields)] pub struct Test { pub name: String, @@ -163,7 +163,7 @@ pub struct Test { pub asserts: Vec, } -#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)] +#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)] #[serde(deny_unknown_fields)] pub struct TestSuite { pub name: String, @@ -180,13 +180,13 @@ pub struct TestSuite { pub suites: Vec, } -#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)] +#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)] #[serde(deny_unknown_fields)] pub struct TestFixture { pub suites: Vec, } -#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)] +#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)] #[serde(deny_unknown_fields)] pub struct BundleDefaults { #[serde(rename = "useIsolating")] @@ -195,7 +195,7 @@ pub struct BundleDefaults { pub locales: Option>, } -#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)] +#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)] #[serde(deny_unknown_fields)] pub struct TestDefaults { pub bundle: BundleDefaults, diff --git a/fluent-bundle/tests/resolver_fixtures.rs b/fluent-bundle/tests/resolver_fixtures.rs index e242a390..711efba2 100644 --- a/fluent-bundle/tests/resolver_fixtures.rs +++ b/fluent-bundle/tests/resolver_fixtures.rs @@ -10,8 +10,8 @@ use fluent_bundle::resolver::ResolverError; use fluent_bundle::FluentArgs; use fluent_bundle::FluentError; use fluent_bundle::{FluentBundle, FluentResource, FluentValue}; -use rand::distributions::Alphanumeric; -use rand::{thread_rng, Rng}; +use rand::distr::Alphanumeric; +use rand::{rng, Rng}; use unic_langid::LanguageIdentifier; use helpers::*; @@ -72,7 +72,7 @@ impl Scope { } fn generate_random_hash() -> String { - let mut rng = thread_rng(); + let mut rng = rng(); let chars: String = iter::repeat(()) .map(|()| rng.sample(Alphanumeric)) .map(char::from) diff --git a/fluent-fallback/CHANGELOG.md b/fluent-fallback/CHANGELOG.md index 739765a4..cc567fb8 100644 --- a/fluent-fallback/CHANGELOG.md +++ b/fluent-fallback/CHANGELOG.md @@ -1,8 +1,10 @@ # Changelog ## Unreleased - - - … + - Refactor to remove unnecessary named lifetimes + - Cleanup docs + - Satiate Clippy + - Bump `once_cell` to 1.21 ## fluent-fallback 0.7.1 (March 16, 2024) - This is a 'safe harbor' release prior to bringing on non-Mozilla community maintainers diff --git a/fluent-fallback/Cargo.toml b/fluent-fallback/Cargo.toml index f9240a6b..fc60c0f7 100644 --- a/fluent-fallback/Cargo.toml +++ b/fluent-fallback/Cargo.toml @@ -22,7 +22,7 @@ rustc-hash.workspace = true unic-langid.workspace = true async-trait = "0.1" chunky-vec = "0.1" -once_cell = "1.19" +once_cell.workspace = true pin-cell = "0.2" [dev-dependencies] diff --git a/fluent-fallback/examples/simple-fallback.rs b/fluent-fallback/examples/simple-fallback.rs index 33fc4e82..08d4cd66 100644 --- a/fluent-fallback/examples/simple-fallback.rs +++ b/fluent-fallback/examples/simple-fallback.rs @@ -32,7 +32,7 @@ use rustc_hash::FxHashSet; use unic_langid::{langid, LanguageIdentifier}; /// This helper struct holds the scheme for converting -/// resource paths into full paths. It is used to customise +/// resource paths into full paths. It is used to customize /// `fluent-fallback::SyncLocalization`. struct Bundles { res_path_scheme: PathBuf, diff --git a/fluent-fallback/src/errors.rs b/fluent-fallback/src/errors.rs index 704bc84f..335d7611 100644 --- a/fluent-fallback/src/errors.rs +++ b/fluent-fallback/src/errors.rs @@ -2,7 +2,7 @@ use fluent_bundle::FluentError; use std::error::Error; use unic_langid::LanguageIdentifier; -#[derive(Debug, PartialEq, Eq)] +#[derive(Debug, Eq, PartialEq)] pub enum LocalizationError { Bundle { error: FluentError, diff --git a/fluent-fallback/src/types.rs b/fluent-fallback/src/types.rs index ad424dad..93b33abc 100644 --- a/fluent-fallback/src/types.rs +++ b/fluent-fallback/src/types.rs @@ -16,19 +16,19 @@ impl<'l> From<&'l str> for L10nKey<'l> { } } -#[derive(Debug, Clone)] +#[derive(Clone, Debug)] pub struct L10nAttribute<'l> { pub name: Cow<'l, str>, pub value: Cow<'l, str>, } -#[derive(Debug, Clone)] +#[derive(Clone, Debug)] pub struct L10nMessage<'l> { pub value: Option>, pub attributes: Vec>, } -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] pub enum ResourceType { /// This is a required resource. /// @@ -53,7 +53,7 @@ pub enum ResourceType { } /// A resource identifier for a localization resource. -#[derive(Debug, Clone)] +#[derive(Clone, Debug)] pub struct ResourceId { /// The resource identifier. pub value: String, diff --git a/fluent-pseudo/CHANGELOG.md b/fluent-pseudo/CHANGELOG.md index 75ed61eb..97a05677 100644 --- a/fluent-pseudo/CHANGELOG.md +++ b/fluent-pseudo/CHANGELOG.md @@ -1,8 +1,10 @@ # Changelog ## Unreleased - - - … + - Eliminate unsafe block using `once_cell` instead of undefined behavior of mutable reference to mutable static + - Cleanup docs + - Satiate Clippy + - Bump `regex` to 1.11 ## fluent-pseudo 0.3.2 (March 16, 2024) - This is a 'safe harbor' release prior to bringing on non-Mozilla community maintainers diff --git a/fluent-pseudo/Cargo.toml b/fluent-pseudo/Cargo.toml index 9ee4063b..9ed8e479 100644 --- a/fluent-pseudo/Cargo.toml +++ b/fluent-pseudo/Cargo.toml @@ -6,7 +6,7 @@ a localization system designed to unleash the entire expressive power of natural """ version = "0.3.2" edition.workspace = true -rust-version = "1.64.0" +rust-version = "1.65.0" homepage.workspace = true repository.workspace = true license.workspace = true @@ -24,4 +24,5 @@ include = [ ] [dependencies] -regex = "1" +once_cell.workspace = true +regex = "1.11" diff --git a/fluent-pseudo/src/lib.rs b/fluent-pseudo/src/lib.rs index 505473e2..4f5af15c 100644 --- a/fluent-pseudo/src/lib.rs +++ b/fluent-pseudo/src/lib.rs @@ -1,3 +1,4 @@ +use once_cell::sync::Lazy; use regex::Captures; use regex::Regex; use std::borrow::Cow; @@ -20,8 +21,8 @@ static FLIPPED_CAPS_MAP: &[char] = &[ '⊥', '∩', 'Ʌ', 'M', 'X', '⅄', 'Z', ]; -static mut RE_EXCLUDED: Option = None; -static mut RE_AZ: Option = None; +static RE_EXCLUDED: Lazy = Lazy::new(|| Regex::new(r"&[#\w]+;|<\s*.+?\s*>").unwrap()); +static RE_AZ: Lazy = Lazy::new(|| Regex::new(r"[a-zA-Z]").unwrap()); pub fn transform_dom(s: &str, flipped: bool, elongate: bool, with_markers: bool) -> Cow { // Exclude access-keys and other single-char messages @@ -30,15 +31,12 @@ pub fn transform_dom(s: &str, flipped: bool, elongate: bool, with_markers: bool) } // XML entities (‪) and XML tags. - let re_excluded = - unsafe { RE_EXCLUDED.get_or_insert_with(|| Regex::new(r"&[#\w]+;|<\s*.+?\s*>").unwrap()) }; - let mut result = Cow::from(s); let mut pos = 0; let mut diff = 0; - for cap in re_excluded.captures_iter(s) { + for cap in RE_EXCLUDED.captures_iter(s) { let capture = cap.get(0).unwrap(); let sub_len = capture.start() - pos; @@ -65,15 +63,13 @@ pub fn transform_dom(s: &str, flipped: bool, elongate: bool, with_markers: bool) } pub fn transform(s: &str, flipped: bool, elongate: bool) -> Cow { - let re_az = unsafe { RE_AZ.get_or_insert_with(|| Regex::new(r"[a-zA-Z]").unwrap()) }; - let (small_map, caps_map) = if flipped { (FLIPPED_SMALL_MAP, FLIPPED_CAPS_MAP) } else { (TRANSFORM_SMALL_MAP, TRANSFORM_CAPS_MAP) }; - re_az.replace_all(s, |caps: &Captures| { + RE_AZ.replace_all(s, |caps: &Captures| { let ch = caps[0].chars().next().unwrap(); let cc = ch as u8; if (97..=122).contains(&cc) { diff --git a/fluent-resmgr/CHANGELOG.md b/fluent-resmgr/CHANGELOG.md index 671ba65a..32b3dc2f 100644 --- a/fluent-resmgr/CHANGELOG.md +++ b/fluent-resmgr/CHANGELOG.md @@ -1,8 +1,9 @@ # Changelog ## Unreleased - - - … + - Cleanup docs + - Satiate Clippy + - Bump `elsa` to 1.10 ## fluent-resmgr 0.0.7 (March 16, 2024) - This is a 'safe harbor' release prior to bringing on non-Mozilla community maintainers diff --git a/fluent-resmgr/src/resource_manager.rs b/fluent-resmgr/src/resource_manager.rs index 9f2cfc57..84b53dfb 100644 --- a/fluent-resmgr/src/resource_manager.rs +++ b/fluent-resmgr/src/resource_manager.rs @@ -144,7 +144,7 @@ impl ResourceManager { } /// Errors generated during the process of retrieving the localization resources -#[derive(Error, Debug)] +#[derive(Debug, Error)] pub enum ResourceManagerError { /// Error while reading the resource file #[error("{0}")] diff --git a/fluent-syntax/CHANGELOG.md b/fluent-syntax/CHANGELOG.md index 592d10ea..435fb448 100644 --- a/fluent-syntax/CHANGELOG.md +++ b/fluent-syntax/CHANGELOG.md @@ -1,8 +1,10 @@ # Changelog ## Unreleased - - Add module `serializer`. - - … + - Add module `serializer` + - De-ambiguate dependencies vs. features + - Cleanup docs + - Satiate Clippy ## fluent-syntax 0.11.1 (March 16, 2024) - This is a 'safe harbor' release prior to bringing on non-Mozilla community maintainers diff --git a/fluent-syntax/src/ast/helper.rs b/fluent-syntax/src/ast/helper.rs index 23851301..89708ee0 100644 --- a/fluent-syntax/src/ast/helper.rs +++ b/fluent-syntax/src/ast/helper.rs @@ -5,7 +5,7 @@ use super::Comment; // This is a helper struct used to properly deserialize referential // JSON comments which are single continuous String, into a vec of // content slices. -#[derive(Debug, PartialEq, Eq, Clone)] +#[derive(Clone, Debug, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde", serde(untagged))] pub enum CommentDef { diff --git a/fluent-syntax/src/ast/mod.rs b/fluent-syntax/src/ast/mod.rs index 273aceaf..51d098bd 100644 --- a/fluent-syntax/src/ast/mod.rs +++ b/fluent-syntax/src/ast/mod.rs @@ -111,7 +111,7 @@ use serde::{Deserialize, Serialize}; /// } /// ); /// ``` -#[derive(Debug, PartialEq, Clone)] +#[derive(Clone, Debug, PartialEq)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct Resource { pub body: Vec>, @@ -193,7 +193,7 @@ pub struct Resource { /// } /// ); /// ``` -#[derive(Debug, PartialEq, Clone)] +#[derive(Clone, Debug, PartialEq)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde", serde(tag = "type"))] pub enum Entry { @@ -253,7 +253,7 @@ pub enum Entry { /// } /// ); /// ``` -#[derive(Debug, PartialEq, Clone)] +#[derive(Clone, Debug, PartialEq)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct Message { pub id: Identifier, @@ -307,7 +307,7 @@ pub struct Message { /// } /// ); /// ``` -#[derive(Debug, PartialEq, Clone)] +#[derive(Clone, Debug, PartialEq)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct Term { pub id: Identifier, @@ -387,7 +387,7 @@ pub struct Term { /// } /// ); /// ``` -#[derive(Debug, PartialEq, Clone)] +#[derive(Clone, Debug, PartialEq)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct Pattern { pub elements: Vec>, @@ -464,7 +464,7 @@ pub struct Pattern { /// } /// ); /// ``` -#[derive(Debug, PartialEq, Clone)] +#[derive(Clone, Debug, PartialEq)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde", serde(tag = "type"))] pub enum PatternElement { @@ -535,7 +535,7 @@ pub enum PatternElement { /// } /// ); /// ``` -#[derive(Debug, PartialEq, Clone)] +#[derive(Clone, Debug, PartialEq)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct Attribute { pub id: Identifier, @@ -584,7 +584,7 @@ pub struct Attribute { /// } /// ); /// ``` -#[derive(Debug, PartialEq, Eq, Clone)] +#[derive(Clone, Debug, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct Identifier { pub name: S, @@ -667,7 +667,7 @@ pub struct Identifier { /// } /// ); /// ``` -#[derive(Debug, PartialEq, Clone)] +#[derive(Clone, Debug, PartialEq)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde", serde(tag = "type"))] pub struct Variant { @@ -752,7 +752,7 @@ pub struct Variant { /// } /// ); /// ``` -#[derive(Debug, PartialEq, Eq, Clone)] +#[derive(Clone, Debug, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde", serde(tag = "type"))] pub enum VariantKey { @@ -798,7 +798,7 @@ pub enum VariantKey { /// } /// ); /// ``` -#[derive(Debug, PartialEq, Eq, Clone)] +#[derive(Clone, Debug, Eq, PartialEq)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde", serde(from = "helper::CommentDef"))] pub struct Comment { @@ -879,7 +879,7 @@ pub struct Comment { /// } /// ); /// ``` -#[derive(Debug, PartialEq, Clone, Default)] +#[derive(Clone, Debug, Default, PartialEq)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde", serde(tag = "type"))] pub struct CallArguments { @@ -948,7 +948,7 @@ pub struct CallArguments { /// } /// ); /// ``` -#[derive(Debug, PartialEq, Clone)] +#[derive(Clone, Debug, PartialEq)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde", serde(tag = "type"))] pub struct NamedArgument { @@ -1004,7 +1004,7 @@ pub struct NamedArgument { /// } /// ); /// ``` -#[derive(Debug, PartialEq, Clone)] +#[derive(Clone, Debug, PartialEq)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde", serde(tag = "type"))] pub enum InlineExpression { @@ -1434,7 +1434,7 @@ pub enum InlineExpression { /// } /// ); /// ``` -#[derive(Debug, PartialEq, Clone)] +#[derive(Clone, Debug, PartialEq)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde", serde(untagged))] pub enum Expression { diff --git a/fluent-syntax/src/parser/comment.rs b/fluent-syntax/src/parser/comment.rs index 1e30fc72..253e168e 100644 --- a/fluent-syntax/src/parser/comment.rs +++ b/fluent-syntax/src/parser/comment.rs @@ -1,7 +1,7 @@ use super::{core::Parser, core::Result, Slice}; use crate::ast; -#[derive(Debug, PartialEq, Clone, Copy)] +#[derive(Clone, Copy, Debug, PartialEq)] pub(super) enum Level { None = 0, Regular = 1, diff --git a/fluent-syntax/src/parser/errors.rs b/fluent-syntax/src/parser/errors.rs index 9bf48d71..9377dad6 100644 --- a/fluent-syntax/src/parser/errors.rs +++ b/fluent-syntax/src/parser/errors.rs @@ -92,7 +92,7 @@ use thiserror::Error; /// The information contained in the `ParserError` should allow the tooling /// to display rich contextual annotations of the error slice, using /// crates such as `annotate-snippers`. -#[derive(Error, Debug, PartialEq, Eq, Clone)] +#[derive(Clone, Debug, Eq, Error, PartialEq)] #[error("{}", self.kind)] pub struct ParserError { /// Precise location of where the parser encountered the error. @@ -122,7 +122,7 @@ macro_rules! error { } /// Kind of an error associated with the [`ParserError`]. -#[derive(Error, Debug, PartialEq, Eq, Clone)] +#[derive(Clone, Debug, Eq, Error, PartialEq)] pub enum ErrorKind { #[error("Expected a token starting with \"{0}\"")] ExpectedToken(char), diff --git a/fluent-syntax/src/serializer.rs b/fluent-syntax/src/serializer.rs index a3442429..30f5ba97 100644 --- a/fluent-syntax/src/serializer.rs +++ b/fluent-syntax/src/serializer.rs @@ -386,7 +386,7 @@ fn is_select_expr<'s, S: Slice<'s>>(expr: &Expression) -> bool { } /// Options for serializing an abstract syntax tree. -#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)] +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] pub struct Options { /// Whether invalid text fragments should be serialized, too. pub with_junk: bool, @@ -397,7 +397,7 @@ struct State { wrote_non_junk_entry: bool, } -#[derive(Debug, Clone, Default)] +#[derive(Clone, Debug, Default)] struct TextWriter { buffer: String, indent_level: usize, diff --git a/fluent-testing/CHANGELOG.md b/fluent-testing/CHANGELOG.md index 40aae598..d4ed5788 100644 --- a/fluent-testing/CHANGELOG.md +++ b/fluent-testing/CHANGELOG.md @@ -1,8 +1,7 @@ # Changelog ## Unreleased - - - … + - Cleanup docs ## fluent-testing 0.0.4 (March 16, 2024) - This is a 'safe harbor' release prior to bringing on non-Mozilla community maintainers diff --git a/fluent/CHANGELOG.md b/fluent/CHANGELOG.md index 8f1e2b28..02eb36bd 100644 --- a/fluent/CHANGELOG.md +++ b/fluent/CHANGELOG.md @@ -1,8 +1,7 @@ # Changelog ## Unreleased - - - … + - Cleanup docs ## fluent 0.16.1 (March 16, 2024) - This is a 'safe harbor' release prior to bringing on non-Mozilla community maintainers diff --git a/intl-memoizer/CHANGELOG.md b/intl-memoizer/CHANGELOG.md index b5adfd32..3314a61e 100644 --- a/intl-memoizer/CHANGELOG.md +++ b/intl-memoizer/CHANGELOG.md @@ -1,8 +1,7 @@ # Changelog ## Unreleased - - - … + - Cleanup docs ## intl-memoizer 0.5.2 (March 16, 2024) - This is a 'safe harbor' release prior to bringing on non-Mozilla community maintainers diff --git a/intl-memoizer/examples/numberformat.rs b/intl-memoizer/examples/numberformat.rs index 793c890c..8020da49 100644 --- a/intl-memoizer/examples/numberformat.rs +++ b/intl-memoizer/examples/numberformat.rs @@ -1,7 +1,7 @@ use intl_memoizer::{IntlMemoizer, Memoizable}; use unic_langid::LanguageIdentifier; -#[derive(Clone, Hash, PartialEq, Eq)] +#[derive(Clone, Eq, Hash, PartialEq)] struct NumberFormatOptions { minimum_fraction_digits: usize, maximum_fraction_digits: usize,