Skip to content

Commit 066dc63

Browse files
added #[no_main] and icu_benchmark_macros
1 parent 76bf5fd commit 066dc63

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

components/calendar/examples/date_try_from_fields.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22
// called LICENSE at the top level of the ICU4X source tree
33
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).
44

5+
#![no_main]
6+
use icu_benchmark_macros::{main_with_provider, println};
57
use icu_calendar::error::DateFromFieldsError;
68
use icu_calendar::types::DateFields;
79
use icu_calendar::{AnyCalendar, AnyCalendarKind, Date};
810

11+
#[main_with_provider]
912
fn main() -> Result<(), DateFromFieldsError> {
1013
let cal = AnyCalendar::new(AnyCalendarKind::Iso);
1114

@@ -15,7 +18,7 @@ fn main() -> Result<(), DateFromFieldsError> {
1518
fields.month_code = Some(b"M07");
1619
fields.day = Some(8);
1720

18-
let date = Date::try_from_fields(fields, Default::default(), cal)?;
21+
let date = Date::try_from_fields(fields, Default::default(), &cal)?;
1922

2023
println!("Constructed date = {:?}", date);
2124

0 commit comments

Comments
 (0)