File tree Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -123,8 +123,6 @@ impl Range {
123
123
pub struct Commit < ' a > {
124
124
/// Commit ID.
125
125
pub id : String ,
126
- /// Timestamp of the commit in seconds, from epoch.
127
- pub timestamp : i64 ,
128
126
/// Commit message including title, description and summary.
129
127
pub message : String ,
130
128
/// Conventional commit.
@@ -202,7 +200,6 @@ impl From<&GitCommit<'_>> for Commit<'_> {
202
200
fn from ( commit : & GitCommit < ' _ > ) -> Self {
203
201
Commit {
204
202
id : commit. id ( ) . to_string ( ) ,
205
- timestamp : commit. time ( ) . seconds ( ) ,
206
203
message : commit. message ( ) . unwrap_or_default ( ) . trim_end ( ) . to_string ( ) ,
207
204
author : commit. author ( ) . into ( ) ,
208
205
committer : commit. committer ( ) . into ( ) ,
@@ -467,7 +464,6 @@ impl Serialize for Commit<'_> {
467
464
468
465
let mut commit = serializer. serialize_struct ( "Commit" , 20 ) ?;
469
466
commit. serialize_field ( "id" , & self . id ) ?;
470
- commit. serialize_field ( "timestamp" , & self . timestamp ) ?;
471
467
if let Some ( conv) = & self . conv {
472
468
commit. serialize_field ( "message" , conv. description ( ) ) ?;
473
469
commit. serialize_field ( "body" , & conv. body ( ) ) ?;
Original file line number Diff line number Diff line change @@ -147,12 +147,12 @@ impl Release<'_> {
147
147
} else {
148
148
self . commits
149
149
. iter ( )
150
- . min_by_key ( |c| c. timestamp )
151
- . zip ( self . commits . iter ( ) . max_by_key ( |c| c. timestamp ) )
150
+ . min_by_key ( |c| c. committer . timestamp )
151
+ . zip ( self . commits . iter ( ) . max_by_key ( |c| c. committer . timestamp ) )
152
152
. and_then ( |( first, last) | {
153
- Utc . timestamp_opt ( first. timestamp , 0 )
153
+ Utc . timestamp_opt ( first. committer . timestamp , 0 )
154
154
. single ( )
155
- . zip ( Utc . timestamp_opt ( last. timestamp , 0 ) . single ( ) )
155
+ . zip ( Utc . timestamp_opt ( last. committer . timestamp , 0 ) . single ( ) )
156
156
. map ( |( start, end) | {
157
157
( end. date_naive ( ) - start. date_naive ( ) ) . num_days ( ) as i32
158
158
} )
You can’t perform that action at this time.
0 commit comments