Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcc35dcf

Browse files
committed
v0.3.41 release
1 parent6de297b commitcc35dcf

25 files changed

+173
-163
lines changed

‎CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ The format is based on [Keep a Changelog]. This project adheres to [Semantic Ver
66

77
---
88

9+
##0.3.41[2025-03-23]
10+
11+
###Fixed
12+
13+
- Compatibility with the latest release of`deranged`. This fix is permanent and covers future
14+
similar changes upstream.
15+
916
##0.3.40[2025-03-18]
1017

1118
###Added

‎Cargo.lock

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

‎Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ resolver = "2"
55

66
[workspace.dependencies]
77
time-core = {path ="time-core",version ="=0.1.4" }
8-
time-macros = {path ="time-macros",version ="=0.2.21" }
8+
time-macros = {path ="time-macros",version ="=0.2.22" }
99

1010
criterion = {version ="0.5.1",default-features =false }
1111
deranged = {version ="0.4.0",default-features =false,features = [
@@ -102,13 +102,14 @@ alloc-instead-of-core = "deny"
102102
std-instead-of-core ="deny"
103103
undocumented-unsafe-blocks ="deny"
104104

105-
missing-docs-in-private-items ="warn"
106105
all = {level ="warn",priority =-1 }
106+
as-underscore ="warn"
107107
dbg-macro ="warn"
108108
decimal-literal-representation ="warn"
109109
explicit-auto-deref ="warn"
110110
get-unwrap ="warn"
111111
manual-let-else ="warn"
112+
missing-docs-in-private-items ="warn"
112113
missing-enforced-import-renames ="warn"
113114
nursery = {level ="warn",priority =-1 }
114115
obfuscated-if-else ="warn"

‎time-macros/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name ="time-macros"
3-
version ="0.2.21"
3+
version ="0.2.22"
44
authors = ["Jacob Pratt <open-source@jhpratt.dev>","Time contributors"]
55
edition ="2021"
66
rust-version ="1.67.1"

‎time-macros/src/format_description/ast.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,9 @@ fn parse_component<'a, I: Iterator<Item = Result<lexer::Token<'a>, Error>>, cons
210210

211211
modifiers.push(Modifier{
212212
_leading_whitespace:unused(whitespace),
213-
key: key.spanned(span.shrink_to_before(colon_indexas_)),
214-
_colon:unused(span.start.offset(colon_indexas_)),
215-
value: value.spanned(span.shrink_to_after(colon_indexas_)),
213+
key: key.spanned(span.shrink_to_before(colon_indexasu32)),
214+
_colon:unused(span.start.offset(colon_indexasu32)),
215+
value: value.spanned(span.shrink_to_after(colon_indexasu32)),
216216
});
217217
};
218218

‎time-macros/src/time.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ pub(crate) fn parse(chars: &mut Peekable<token_stream::IntoIter>) -> Result<Time
8787
span_start:Some(minute_span),
8888
span_end:Some(minute_span),
8989
})
90-
}elseif second >=Second::per(Minute)as_{
90+
}elseif second >=Second::per(Minute)asf64{
9191
Err(Error::InvalidComponent{
9292
name:"second",
9393
value: second.to_string(),
@@ -98,8 +98,8 @@ pub(crate) fn parse(chars: &mut Peekable<token_stream::IntoIter>) -> Result<Time
9898
Ok(Time{
9999
hour,
100100
minute,
101-
second: second.trunc()as_,
102-
nanosecond:(second.fract()*Nanosecond::per(Second)asf64).round()as_,
101+
second: second.trunc()asu8,
102+
nanosecond:(second.fract()*Nanosecond::per(Second)asf64).round()asu32,
103103
})
104104
}
105105
}

‎time/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name ="time"
3-
version ="0.3.40"
3+
version ="0.3.41"
44
authors = ["Jacob Pratt <open-source@jhpratt.dev>","Time contributors"]
55
edition ="2021"
66
rust-version ="1.67.1"

‎time/src/date.rs

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ impl Date {
141141
returnErr(error::ComponentRange{
142142
name:"day",
143143
minimum:1,
144-
maximum: month.length(year)as_,
145-
value: dayas_,
144+
maximum: month.length(year)asi64,
145+
value: dayasi64,
146146
conditional_message:Some("for the given month and year"),
147147
});
148148
}
@@ -179,8 +179,8 @@ impl Date {
179179
returnErr(error::ComponentRange{
180180
name:"ordinal",
181181
minimum:1,
182-
maximum:days_in_year(year)as_,
183-
value: ordinalas_,
182+
maximum:days_in_year(year)asi64,
183+
value: ordinalasi64,
184184
conditional_message:Some("for the given year"),
185185
});
186186
}
@@ -216,8 +216,8 @@ impl Date {
216216
returnErr(error::ComponentRange{
217217
name:"week",
218218
minimum:1,
219-
maximum:weeks_in_year(year)as_,
220-
value: weekas_,
219+
maximum:weeks_in_year(year)asi64,
220+
value: weekasi64,
221221
conditional_message:Some("for the given year"),
222222
});
223223
}
@@ -252,7 +252,7 @@ impl Date {
252252
}
253253
}else{
254254
// Safety: `ordinal` is not zero.
255-
unsafe{Self::__from_ordinal_date_unchecked(year, ordinalas_)}
255+
unsafe{Self::__from_ordinal_date_unchecked(year, ordinalasu16)}
256256
})
257257
}
258258

@@ -316,7 +316,7 @@ impl Date {
316316

317317
// Safety: `ordinal` is not zero and `is_leap_year` is correct, so long as the Julian day
318318
// number is in range.
319-
unsafe{Self::from_parts(y_g, is_leap_year, ordinalas_)}
319+
unsafe{Self::from_parts(y_g, is_leap_year, ordinalasu16)}
320320
}
321321

322322
/// Whether `is_leap_year(self.year())` is `true`.
@@ -391,7 +391,7 @@ impl Date {
391391
let ordinal = ordinal - ordinal_adj;
392392
let month =(ordinal*268 +8031) >>13;
393393
let days_in_preceding_months =(month*3917 -3866) >>7;
394-
(ordinal - days_in_preceding_months)as_
394+
(ordinal - days_in_preceding_months)asu8
395395
}
396396

397397
/// Get the day of the year.
@@ -404,14 +404,14 @@ impl Date {
404404
/// assert_eq!(date!(2019-12-31).ordinal(), 365);
405405
/// ```
406406
pubconstfnordinal(self) ->u16{
407-
(self.value.get()&0x1FF)as_
407+
(self.value.get()&0x1FF)asu16
408408
}
409409

410410
/// Get the ISO 8601 year and week number.
411411
pub(crate)constfniso_year_week(self) ->(i32,u8){
412412
let(year, ordinal) =self.to_ordinal_date();
413413

414-
match((ordinal +10 -self.weekday().number_from_monday()asu16) /7)as_{
414+
match((ordinal +10 -self.weekday().number_from_monday()asu16) /7)asu8{
415415
0 =>(year -1,weeks_in_year(year -1)),
416416
53ifweeks_in_year(year) ==52 =>(year +1,1),
417417
week =>(year, week),
@@ -446,7 +446,7 @@ impl Date {
446446
/// assert_eq!(date!(2021-01-01).sunday_based_week(), 0);
447447
/// ```
448448
pubconstfnsunday_based_week(self) ->u8{
449-
((self.ordinal()asi16 -self.weekday().number_days_from_sunday()asi16 +6) /7)as_
449+
((self.ordinal()asi16 -self.weekday().number_days_from_sunday()asi16 +6) /7)asu8
450450
}
451451

452452
/// Get the week number where week 1 begins on the first Monday.
@@ -461,7 +461,7 @@ impl Date {
461461
/// assert_eq!(date!(2021-01-01).monday_based_week(), 0);
462462
/// ```
463463
pubconstfnmonday_based_week(self) ->u8{
464-
((self.ordinal()asi16 -self.weekday().number_days_from_monday()asi16 +6) /7)as_
464+
((self.ordinal()asi16 -self.weekday().number_days_from_monday()asi16 +6) /7)asu8
465465
}
466466

467467
/// Get the year, month, and day.
@@ -529,7 +529,7 @@ impl Date {
529529
let(year, ordinal) =self.to_ordinal_date();
530530
let weekday =self.weekday();
531531

532-
match((ordinal +10 - weekday.number_from_monday()asu16) /7)as_{
532+
match((ordinal +10 - weekday.number_from_monday()asu16) /7)asu8{
533533
0 =>(year -1,weeks_in_year(year -1), weekday),
534534
53ifweeks_in_year(year) ==52 =>(year +1,1, weekday),
535535
week =>(year, week, weekday),
@@ -779,7 +779,7 @@ impl Date {
779779
returnNone;
780780
}
781781

782-
let julian_day =const_try_opt!(self.to_julian_day().checked_add(whole_daysas_));
782+
let julian_day =const_try_opt!(self.to_julian_day().checked_add(whole_daysasi32));
783783
ifletOk(date) =Self::from_julian_day(julian_day){
784784
Some(date)
785785
}else{
@@ -822,7 +822,7 @@ impl Date {
822822
returnNone;
823823
}
824824

825-
let julian_day =const_try_opt!(self.to_julian_day().checked_add(whole_daysas_));
825+
let julian_day =const_try_opt!(self.to_julian_day().checked_add(whole_daysasi32));
826826
ifletOk(date) =Self::from_julian_day(julian_day){
827827
Some(date)
828828
}else{
@@ -867,7 +867,7 @@ impl Date {
867867
returnNone;
868868
}
869869

870-
let julian_day =const_try_opt!(self.to_julian_day().checked_sub(whole_daysas_));
870+
let julian_day =const_try_opt!(self.to_julian_day().checked_sub(whole_daysasi32));
871871
ifletOk(date) =Self::from_julian_day(julian_day){
872872
Some(date)
873873
}else{
@@ -910,7 +910,7 @@ impl Date {
910910
returnNone;
911911
}
912912

913-
let julian_day =const_try_opt!(self.to_julian_day().checked_sub(whole_daysas_));
913+
let julian_day =const_try_opt!(self.to_julian_day().checked_sub(whole_daysasi32));
914914
ifletOk(date) =Self::from_julian_day(julian_day){
915915
Some(date)
916916
}else{
@@ -1141,8 +1141,8 @@ impl Date {
11411141
returnErr(error::ComponentRange{
11421142
name:"day",
11431143
minimum:1,
1144-
maximum:self.month().length(self.year())as_,
1145-
value: dayas_,
1144+
maximum:self.month().length(self.year())asi64,
1145+
value: dayasi64,
11461146
conditional_message:Some("for the given month and year"),
11471147
});
11481148
}
@@ -1152,7 +1152,7 @@ impl Date {
11521152
Ok(unsafe{
11531153
Self::__from_ordinal_date_unchecked(
11541154
self.year(),
1155-
(self.ordinal()asi16 -self.day()asi16 + dayasi16)as_,
1155+
(self.ordinal()asi16 -self.day()asi16 + dayasi16)asu16,
11561156
)
11571157
})
11581158
}
@@ -1174,8 +1174,8 @@ impl Date {
11741174
returnErr(error::ComponentRange{
11751175
name:"ordinal",
11761176
minimum:1,
1177-
maximum:days_in_year(self.year())as_,
1178-
value: ordinalas_,
1177+
maximum:days_in_year(self.year())asi64,
1178+
value: ordinalasi64,
11791179
conditional_message:Some("for the given year"),
11801180
});
11811181
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp