浏览代码

Run fmt.sh

jD91mZM2 6 年之前
父节点
当前提交
758b437170
共有 1 个文件被更改,包括 3 次插入7 次删除
  1. 3 7
      src/time/src/lib.rs

+ 3 - 7
src/time/src/lib.rs

@@ -218,11 +218,7 @@ pub unsafe extern "C" fn localtime_r(clock: *const time_t, r: *mut tm) -> *mut t
     (*r).tm_year = 1970;
 
     loop {
-        let days_in_year = if leap_year((*r).tm_year) {
-            366
-        } else {
-            365
-        };
+        let days_in_year = if leap_year((*r).tm_year) { 366 } else { 365 };
 
         if days < days_in_year {
             break;
@@ -240,9 +236,9 @@ pub unsafe extern "C" fn localtime_r(clock: *const time_t, r: *mut tm) -> *mut t
 
     const MONTH_DAYS: [[c_int; 12]; 2] = [
         // Non-leap years:
-        [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ],
+        [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],
         // Leap years:
-        [ 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ],
+        [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],
     ];
 
     let leap = if leap_year((*r).tm_year) { 1 } else { 0 };