Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed Dec 13, 2024
1 parent 733e21a commit 9bfe85f
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions ffi/capi/src/casemap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ pub mod ffi {
#[cfg(feature = "buffer_provider")]
pub fn create_with_provider(provider: &DataProvider) -> Result<Box<CaseMapper>, DataError> {
Ok(Box::new(CaseMapper(provider.call_constructor(
|provider| icu_casemap::CaseMapper::try_new_with_buffer_provider(provider),
icu_casemap::CaseMapper::try_new_with_buffer_provider,
)?)))
}
/// Returns the full lowercase mapping of the given string
Expand Down Expand Up @@ -237,7 +237,7 @@ pub mod ffi {
provider: &DataProvider,
) -> Result<Box<CaseMapCloser>, DataError> {
Ok(Box::new(CaseMapCloser(provider.call_constructor(
|provider| icu_casemap::CaseMapCloser::try_new_with_buffer_provider(provider),
icu_casemap::CaseMapCloser::try_new_with_buffer_provider,
)?)))
}
/// Adds all simple case mappings and the full case folding for `c` to `builder`.
Expand Down Expand Up @@ -294,7 +294,7 @@ pub mod ffi {
provider: &DataProvider,
) -> Result<Box<TitlecaseMapper>, DataError> {
Ok(Box::new(TitlecaseMapper(provider.call_constructor(
|provider| icu_casemap::TitlecaseMapper::try_new_with_buffer_provider(provider),
icu_casemap::TitlecaseMapper::try_new_with_buffer_provider,
)?)))
}
/// Returns the full titlecase mapping of the given string
Expand Down
2 changes: 1 addition & 1 deletion ffi/capi/src/fallbacker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ pub mod ffi {
provider: &DataProvider,
) -> Result<Box<LocaleFallbacker>, DataError> {
Ok(Box::new(LocaleFallbacker(provider.call_constructor(
|provider| icu_locale::LocaleFallbacker::try_new_with_buffer_provider(provider),
icu_locale::LocaleFallbacker::try_new_with_buffer_provider,
)?)))
}

Expand Down
6 changes: 3 additions & 3 deletions ffi/capi/src/locale.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub mod ffi {
provider: &DataProvider,
) -> Result<Box<LocaleCanonicalizer>, DataError> {
Ok(Box::new(LocaleCanonicalizer(provider.call_constructor(
|provider| icu_locale::LocaleCanonicalizer::try_new_with_buffer_provider(provider),
icu_locale::LocaleCanonicalizer::try_new_with_buffer_provider,
)?)))
}
/// Create a new [`LocaleCanonicalizer`] with extended data using compiled data.
Expand Down Expand Up @@ -99,7 +99,7 @@ pub mod ffi {
provider: &DataProvider,
) -> Result<Box<LocaleExpander>, DataError> {
Ok(Box::new(LocaleExpander(provider.call_constructor(
|provider| icu_locale::LocaleExpander::try_new_with_buffer_provider(provider),
icu_locale::LocaleExpander::try_new_with_buffer_provider,
)?)))
}
/// Create a new [`LocaleExpander`] with extended data using compiled data.
Expand All @@ -117,7 +117,7 @@ pub mod ffi {
provider: &DataProvider,
) -> Result<Box<LocaleExpander>, DataError> {
Ok(Box::new(LocaleExpander(provider.call_constructor(
|provider| icu_locale::LocaleExpander::try_new_with_buffer_provider(provider),
icu_locale::LocaleExpander::try_new_with_buffer_provider,
)?)))
}
#[diplomat::rust_link(icu::locale::LocaleExpander::maximize, FnInStruct)]
Expand Down
2 changes: 1 addition & 1 deletion ffi/capi/src/locale_directionality.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub mod ffi {
provider: &DataProvider,
) -> Result<Box<LocaleDirectionality>, DataError> {
Ok(Box::new(LocaleDirectionality(provider.call_constructor(
|provider| icu_locale::LocaleDirectionality::try_new_with_buffer_provider(provider),
icu_locale::LocaleDirectionality::try_new_with_buffer_provider,
)?)))
}

Expand Down
4 changes: 2 additions & 2 deletions ffi/capi/src/normalizer_properties.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub mod ffi {
pub fn create_with_provider(
provider: &DataProvider,
) -> Result<Box<CanonicalCombiningClassMap>, DataError> {
Ok(Box::new(CanonicalCombiningClassMap(provider.call_constructor(|provider| icu_normalizer::properties::CanonicalCombiningClassMap::try_new_with_buffer_provider(provider))?)))
Ok(Box::new(CanonicalCombiningClassMap(provider.call_constructor(icu_normalizer::properties::CanonicalCombiningClassMap::try_new_with_buffer_provider)?)))
}

#[diplomat::rust_link(
Expand Down Expand Up @@ -204,7 +204,7 @@ pub mod ffi {
pub fn create_with_provider(
provider: &DataProvider,
) -> Result<Box<CanonicalDecomposition>, DataError> {
Ok(Box::new(CanonicalDecomposition(provider.call_constructor(|provider| icu_normalizer::properties::CanonicalDecomposition::try_new_with_buffer_provider(provider))?)))
Ok(Box::new(CanonicalDecomposition(provider.call_constructor(icu_normalizer::properties::CanonicalDecomposition::try_new_with_buffer_provider)?)))
}

/// Performs non-recursive canonical decomposition (including for Hangul).
Expand Down
2 changes: 1 addition & 1 deletion ffi/capi/src/segmenter_sentence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ pub mod ffi {
provider: &DataProvider,
) -> Result<Box<SentenceSegmenter>, DataError> {
Ok(Box::new(SentenceSegmenter(provider.call_constructor(
|provider| icu_segmenter::SentenceSegmenter::try_new_with_buffer_provider(provider),
icu_segmenter::SentenceSegmenter::try_new_with_buffer_provider,
)?)))
}

Expand Down
4 changes: 2 additions & 2 deletions ffi/capi/src/timezone_mapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub mod ffi {
provider: &DataProvider,
) -> Result<Box<TimeZoneIdMapper>, DataError> {
Ok(Box::new(TimeZoneIdMapper(provider.call_constructor(
|provider| icu_timezone::TimeZoneIdMapper::try_new_with_buffer_provider(provider),
icu_timezone::TimeZoneIdMapper::try_new_with_buffer_provider,
)?)))
}

Expand Down Expand Up @@ -172,7 +172,7 @@ pub mod ffi {
provider: &DataProvider,
) -> Result<Box<TimeZoneIdMapperWithFastCanonicalization>, DataError> {
Ok(Box::new(TimeZoneIdMapperWithFastCanonicalization(
provider.call_constructor(|provider| icu_timezone::TimeZoneIdMapperWithFastCanonicalization::try_new_with_buffer_provider(provider))?,
provider.call_constructor(icu_timezone::TimeZoneIdMapperWithFastCanonicalization::try_new_with_buffer_provider)?,
)))
}

Expand Down
2 changes: 1 addition & 1 deletion ffi/capi/src/units_converter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pub mod ffi {
pub fn create_with_provider(
provider: &DataProvider,
) -> Result<Box<UnitsConverterFactory>, DataError> {
Ok(Box::new(UnitsConverterFactory(provider.call_constructor(|provider| icu_experimental::units::converter_factory::ConverterFactory::try_new_with_buffer_provider(provider))?)))
Ok(Box::new(UnitsConverterFactory(provider.call_constructor(icu_experimental::units::converter_factory::ConverterFactory::try_new_with_buffer_provider)?)))
}
/// Creates a new [`UnitsConverter`] from the input and output [`MeasureUnit`]s.
/// Returns nothing if the conversion between the two units is not possible.
Expand Down

0 comments on commit 9bfe85f

Please sign in to comment.