Skip to content

Commit

Permalink
Make some traits pub(crate) if they are able to be made pub(crate)
Browse files Browse the repository at this point in the history
  • Loading branch information
sffc committed Nov 20, 2023
1 parent 9bf2525 commit a8b3f6a
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions components/calendar/src/calendar_arithmetic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use tinystr::tinystr;
// Note: The Ord/PartialOrd impls can be derived because the fields are in the correct order.
#[derive(Debug, Hash, Eq, PartialEq, Ord, PartialOrd)]
#[allow(clippy::exhaustive_structs)] // this type is stable
pub struct ArithmeticDate<C> {
pub(crate) struct ArithmeticDate<C> {
pub year: i32,
/// 1-based month of year
pub month: u8,
Expand All @@ -30,7 +30,7 @@ impl<C> Clone for ArithmeticDate<C> {
#[allow(dead_code)] // TODO: Remove dead code tag after use
pub(crate) const MAX_ITERS_FOR_DAYS_OF_MONTH: u8 = 33;

pub trait CalendarArithmetic: Calendar {
pub(crate) trait CalendarArithmetic: Calendar {
fn month_days(year: i32, month: u8) -> u8;
fn months_for_every_year(year: i32) -> u8;
fn is_leap_year(year: i32) -> bool;
Expand Down
2 changes: 1 addition & 1 deletion components/datetime/src/datetime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use icu_provider::prelude::*;
use writeable::Writeable;

use crate::{
calendar, input::DateInput, input::DateTimeInput, input::IsoTimeInput, CldrCalendar,
calendar, input::DateInput, input::DateTimeInput, input::IsoTimeInput, calendar::CldrCalendar,
DateTimeError, FormattedDateTime,
};

Expand Down
1 change: 1 addition & 0 deletions components/datetime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ mod zoned_datetime;
mod any;

pub use any::{DateFormatter, DateTimeFormatter, ZonedDateTimeFormatter};
// TODO(#2856): Stop exporting CldrCalendar
pub use calendar::CldrCalendar;
pub use datetime::{TimeFormatter, TypedDateFormatter, TypedDateTimeFormatter};
pub use error::DateTimeError;
Expand Down
7 changes: 5 additions & 2 deletions components/datetime/src/provider/date_time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ where
}
}

pub trait DateSymbols<'data> {
pub(crate) trait DateSymbols<'data> {
/// The bool is `true` if the return value is a leap month fallback needing a qualifier.
fn get_symbol_for_month(
&self,
Expand Down Expand Up @@ -445,7 +445,10 @@ impl<'data> DateSymbols<'data> for provider::calendar::DateSymbolsV1<'data> {
}
}

pub trait TimeSymbols {
pub(crate) trait TimeSymbols {
/// Gets the day period symbol.
///
/// Internally, 'noon' and 'midnight' should fall back to 'am' and 'pm'.
fn get_symbol_for_day_period(
&self,
day_period: fields::DayPeriod,
Expand Down
2 changes: 1 addition & 1 deletion components/datetime/src/zoned_datetime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use crate::{
},
raw,
time_zone::TimeZoneFormatterOptions,
CldrCalendar, DateTimeError,
calendar::CldrCalendar, DateTimeError,
};

/// The composition of [`TypedDateTimeFormatter`](crate::TypedDateTimeFormatter) and [`TimeZoneFormatter`].
Expand Down
2 changes: 1 addition & 1 deletion experimental/zerotrie/src/builder/nonconst/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use alloc::collections::VecDeque;
use alloc::vec::Vec;

/// A trait applied to a data structure for building a ZeroTrie.
pub trait TrieBuilderStore {
pub(crate) trait TrieBuilderStore {
/// Create a new empty store.
fn atbs_new_empty() -> Self;

Expand Down

0 comments on commit a8b3f6a

Please sign in to comment.