Skip to content

Commit a0fe12e

Browse files
authored
Don't re-export datetime::Length. Improve rust links and allowlist (#6446)
1 parent 7997d1c commit a0fe12e

File tree

82 files changed

+2389
-458
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+2389
-458
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ icu = "1.5.0"
3737

3838
```rust
3939
use icu::calendar::Date;
40-
use icu::datetime::{DateTimeFormatter, Length, fieldsets::YMD};
40+
use icu::datetime::{DateTimeFormatter, fieldsets::YMD};
4141
use icu::locale::locale;
4242

4343
let dtf = DateTimeFormatter::try_new(

components/datetime/src/builder.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,22 @@ impl DateFields {
154154
Self::YM,
155155
Self::Y,
156156
];
157+
158+
/// Returns whether this [`DateFields`] variant represents a [`CalendarPeriodFieldSet`].
159+
pub fn is_calendar_period(self) -> bool {
160+
match self {
161+
DateFields::D => false,
162+
DateFields::MD => false,
163+
DateFields::YMD => false,
164+
DateFields::DE => false,
165+
DateFields::MDE => false,
166+
DateFields::YMDE => false,
167+
DateFields::E => false,
168+
DateFields::M => true,
169+
DateFields::YM => true,
170+
DateFields::Y => true,
171+
}
172+
}
157173
}
158174

159175
/// An enumeration over all possible time zone styles.

components/datetime/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ pub use neo::FixedCalendarDateTimeFormatter;
118118
pub use neo::FormattedDateTime;
119119
pub use neo::FormattedDateTimeUnchecked;
120120
pub use neo::NoCalendarFormatter;
121-
pub use options::Length;
122121

123122
/// Locale preferences used by this crate
124123
pub mod preferences {

components/datetime/src/provider/packed_pattern.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use super::pattern::{
88
runtime::{Pattern, PatternBorrowed, PatternMetadata},
99
PatternItem,
1010
};
11-
use crate::{size_test_macro::size_test, Length};
11+
use crate::{options::Length, size_test_macro::size_test};
1212
use alloc::vec::Vec;
1313
use icu_plurals::{
1414
provider::{FourBitMetadata, PluralElementsPackedULE},

components/icu/README.md

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/icu/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
//! Compiled data is exposed through idiomatic Rust constructors like `new` or `try_new`:
2929
//!
3030
//! ```
31-
//! use icu::datetime::{fieldsets::YMD, DateTimeFormatter, Length};
31+
//! use icu::datetime::{fieldsets::YMD, DateTimeFormatter};
3232
//! use icu::locale::locale;
3333
//!
3434
//! let dtf =
@@ -49,7 +49,7 @@
4949
//! special constructors:
5050
//!
5151
//! ```no_run
52-
//! use icu::datetime::{fieldsets::YMD, DateTimeFormatter, Length};
52+
//! use icu::datetime::{fieldsets::YMD, DateTimeFormatter};
5353
//! use icu::locale::fallback::LocaleFallbacker;
5454
//! use icu::locale::locale;
5555
//! use icu_provider_adapters::fallback::LocaleFallbackProvider;

ffi/capi/bindings/cpp/icu4x/DateFormatter.d.hpp

Lines changed: 41 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ffi/capi/bindings/cpp/icu4x/DateFormatterGregorian.d.hpp

Lines changed: 41 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ffi/capi/bindings/cpp/icu4x/DateTimeAlignment.d.hpp

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ffi/capi/bindings/cpp/icu4x/DateTimeFormatter.d.hpp

Lines changed: 29 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)