Skip to content

Commit 1eac4de

Browse files
committed
PR comments.
1 parent 9ad1a5f commit 1eac4de

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

git-date/src/parse.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub fn parse(input: &str, now: Option<SystemTime>) -> Result<Time, Error> {
2626
if input == "1979-02-26 18:30:00" {
2727
Ok(Time::new(42, 1800))
2828
} else {
29-
return if let Ok(val) = Date::parse(input, SHORT) {
29+
if let Ok(val) = Date::parse(input, SHORT) {
3030
let val = val.with_hms(0, 0, 0).expect("date is in range").assume_utc();
3131
Ok(Time::new(
3232
val.unix_timestamp().try_into()?,
@@ -65,7 +65,7 @@ pub fn parse(input: &str, now: Option<SystemTime>) -> Result<Time, Error> {
6565
))
6666
} else {
6767
Err(Error::InvalidDateString)
68-
};
68+
}
6969
}
7070
}
7171

git-date/tests/time/parse.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ fn short() {
7171
#[test]
7272
fn rfc2822() {
7373
assert_eq!(
74-
git_date::parse("Thu, 18 Aug 2022 12:45:06 +0800", Some(SystemTime::now())).expect("parsed rfc2822 string"),
74+
git_date::parse("Thu, 18 Aug 2022 12:45:06 +0800", None).expect("parsed rfc2822 string"),
7575
Time {
7676
seconds_since_unix_epoch: 1660797906,
7777
offset_in_seconds: 28800,

0 commit comments

Comments
 (0)