Skip to content
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

Make all eligible options bags Copy #4757

Merged
merged 2 commits into from
Mar 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/casemap/src/internals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const ACUTE: char = '\u{301}';

// Used to control the behavior of CaseMapper::fold.
// Currently only used to decide whether to use Turkic (T) mappings for dotted/dotless i.
#[derive(Default)]
#[derive(Copy, Clone, Default)]
pub struct FoldOptions {
exclude_special_i: bool,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

/// A collection of configuration options that determine the formatting behavior of
/// [`CurrencyFormatter`](crate::dimension::currency::formatter::CurrencyFormatter).
#[derive(Debug, Eq, PartialEq, Clone, Default)]
#[derive(Copy, Debug, Eq, PartialEq, Clone, Default)]
#[non_exhaustive]
pub struct CurrencyFormatterOptions {
/// The width of the currency format.
Expand Down
2 changes: 1 addition & 1 deletion components/experimental/src/displaynames/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
/// // Full name would be "Bosnia & Herzegovina"
/// assert_eq!(display_name.of(region!("BA")), Some("Bosnia"));
/// ```
#[derive(Debug, Eq, PartialEq, Clone, Default)]
#[derive(Copy, Debug, Eq, PartialEq, Clone, Default)]
#[non_exhaustive]
pub struct DisplayNamesOptions {
/// The optional formatting style to use for display name.
Expand Down
2 changes: 1 addition & 1 deletion components/segmenter/src/line.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ pub enum LineBreakWordOption {

/// Options to tailor line-breaking behavior.
#[non_exhaustive]
#[derive(Clone, PartialEq, Eq, Debug)]
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
pub struct LineBreakOptions {
/// Strictness of line-breaking rules. See [`LineBreakStrictness`].
pub strictness: LineBreakStrictness,
Expand Down
2 changes: 2 additions & 0 deletions documents/process/graduation.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ This document contains a checklist for the requirements to migrate a component f
- [ ] All options and conditional code paths should have a corresponding docs test with the heading `# Examples`
- [ ] All functions that are conditional on a Cargo feature should say so (last line before `# Examples`): ```✨ *Enabled with the `alloc` Cargo feature.*```
- [ ] Compiled data constructors should say "with compiled data" in the first sentence and should have a Cargo feature alert following the above syntax.
- [ ] The APIs should follow ICU4X style
- [ ] All options bags should be `Copy` (and contain references if they need to). Exceptions can be made by discussion.
- [ ] The data structs should fully follow ZeroVec style
- [ ] Deserialization should not have a "zero-copy violation" in the [make-testdata](https://github.com/unicode-org/icu4x/blob/main/provider/datagen/tests/make-testdata.rs) test
- [ ] Constructors should avoid allocating memory in the common case
Expand Down
Loading