Skip to content

Commit

Permalink
baked
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed Nov 13, 2024
1 parent 2d2bbc7 commit 8ab5f3d
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions tutorials/data_provider.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,20 +226,11 @@ where
}
}

// Load some en-US data as a base. Baked is the provider for icu::decimal's builtin
// "compiled data" that it ships by default.
let data = icu::decimal::provider::Baked
.load(DataRequest {
id: DataIdentifierBorrowed::for_locale(&locale!("en-US").into()),
..Default::default()
})
.unwrap()
.payload;

// Make a wrapped provider that modifies Swiss data requests
let provider = CustomDecimalSymbolsProvider(
// Make a simple data provider that provides the loaded en-US data unconditionally
FixedProvider::<DecimalSymbolsV1Marker>::from_payload(data)
// Base our provider off of the default builtin
// "compiled data" shipped by icu::decimal by default.
icu::decimal::provider::Baked
);

let formatter = FixedDecimalFormatter::try_new_unstable(
Expand Down

0 comments on commit 8ab5f3d

Please sign in to comment.