Commit a9eff48
committed
Add from_nanos_u128 to Duration for handling large time spans
Add unstable attribute
Add unstable attribute for `from_nanos_u128` with tracking issue #139201
Co-authored-by: Madhav Madhusoodanan <madhavmadhusoodanan@gmail.com>
add feature gate for the new function
- add feature gate
- remove trailing whitespace
Add feature gate at the right place
Co-authored-by: Madhav Madhusoodanan <madhavmadhusoodanan@gmail.com>
Update time.rs
making sure seconds are in u64
Co-authored-by: Madhav Madhusoodanan <madhavmadhusoodanan@gmail.com>
Update time.rs
keeping seconds as u64
removing the use of non const function within const function
Use a u128 example time.rs
Earlier for the example I used 2.pow(64).
correcting it to use u128 type which can contain the value
Synched my fork Dummy commit
dummy commit.
sync local with fork
style: format code with rustfmt
Add panic test for Duration::from_nanos_u128
fix: remove non-const .into() call from const function
A const function cannot call non-const functions, so we remove the trailing
.into() call and use raw literals instead.
remove paratheses
Add comment on largest input and explain safety assumption
Ran Rust fmt again1 parent b8005bf commit a9eff48
2 files changed
+36
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
228 | | - | |
| 228 | + | |
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
| |||
6415 | 6415 | | |
6416 | 6416 | | |
6417 | 6417 | | |
6418 | | - | |
| 6418 | + | |
6419 | 6419 | | |
6420 | | - | |
| 6420 | + | |
6421 | 6421 | | |
6422 | 6422 | | |
6423 | 6423 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | 2 | | |
4 | 3 | | |
5 | 4 | | |
| |||
308 | 307 | | |
309 | 308 | | |
310 | 309 | | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
311 | 343 | | |
312 | 344 | | |
313 | 345 | | |
| |||
0 commit comments