Skip to content

Commit

Permalink
fix style lint errors all CI plats
Browse files Browse the repository at this point in the history
  • Loading branch information
g-k committed Apr 3, 2022
1 parent 6f7e7f3 commit a36fbbf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/uu/touch/src/touch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,13 +268,13 @@ fn parse_date(s: &str) -> UResult<FileTime> {
// which is equivalent to the POSIX locale: %a %b %e %H:%M:%S %Y
// Tue Dec 3 ...
// ("%c", POSIX_LOCALE_FORMAT),
if let Ok(parsed) = time::PrimitiveDateTime::parse(&s, &POSIX_LOCALE_FORMAT) {
if let Ok(parsed) = time::PrimitiveDateTime::parse(s, &POSIX_LOCALE_FORMAT) {
return Ok(local_dt_to_filetime(to_local(parsed)));
}

// "Equivalent to %Y-%m-%d (the ISO 8601 date format). (C99)"
// ("%F", ISO_8601_FORMAT),
if let Ok(parsed) = time::Date::parse(&s, &ISO_8601_FORMAT) {
if let Ok(parsed) = time::Date::parse(s, &ISO_8601_FORMAT) {
return Ok(local_dt_to_filetime(to_local(
time::PrimitiveDateTime::new(parsed, time!(00:00)),
)));
Expand Down
2 changes: 1 addition & 1 deletion src/uucore/src/lib/features/utmpx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ impl Utmpx {
/// A.K.A. ut.ut_tv
pub fn login_time(&self) -> time::OffsetDateTime {
let ts_nanos: i128 = (self.inner.ut_tv.tv_sec * 1_000_000_000
+ self.inner.ut_tv.tv_usec as i64 * 1_000)
+ self.inner.ut_tv.tv_usec as i64 * 1_000 as i64)
.into();
let local_offset = time::OffsetDateTime::now_local().unwrap().offset();
time::OffsetDateTime::from_unix_timestamp_nanos(ts_nanos)
Expand Down

0 comments on commit a36fbbf

Please sign in to comment.