Commit Graph

16 Commits (master)

Author SHA1 Message Date
mkb2091 b3f93117d2 Fixed typo 2021-10-19 22:45:26 +01:00
Dario Nieuwenhuis d98f56f8bd time: fix incorrect conversion from std 2021-10-07 04:57:59 +02:00
qiujiangkun acfa7f0b19 use micros in Instant and Duration 2021-10-05 22:33:58 +02:00
Thibaut Vandervelden 6a27136047 Fix clippy lints 2021-08-18 16:05:50 +02:00
qiujiangkun a43fb222e9 pcap timestamp bugfix 2021-07-01 22:27:10 +08:00
Dario Nieuwenhuis 98fe17890a rustfmt 2021-06-27 09:31:59 +02:00
Dario Nieuwenhuis b1f2bcb678 dhcp: retry REQUEST slower and with exponential backoff. Fixes #464 2021-04-07 21:52:26 +02:00
Dario Nieuwenhuis d64c8593f0 Add defmt logging support 2021-04-01 01:30:47 +02:00
Dario Nieuwenhuis 0752945161 Make some time funcs const. 2021-01-04 01:37:06 +01:00
Alex Crawford 737fdf7bbf Use subsec_millis where possible
These were flagged by `cargo clippy`:

    warning: calling `subsec_millis()` is more concise than this
             calculation
2020-12-27 17:00:03 -08:00
David Wood 67653fbf38 Pad output of `Display` on `Instant`
Zero-pad the milliseconds part of a displayed `Instant` to include
three leading zeros.
Closes: #297
Approved by: whitequark
2019-05-28 06:25:37 +08:00
Alex Crawford 2477355516 Allow more integer types when creating Instants
This allows any type that can be converted into an `i64` to be used when
creating an Instant. Because this is no longer a concrete type, this
change may break existing code like the following:

    error: attempt to multiply with overflow
       --> src/time.rs:282:37
        |
    282 |         epoc = Instant::from_millis(2085955200 * 1000).into();
        |                                     ^^^^^^^^^^^^^^^^^
        |
        = note: #[deny(const_err)] on by default

Closes: #272
Approved by: whitequark
2019-01-28 06:37:39 +08:00
whitequark 6067607442 Fix errors caused by an update to #[deny(unused)]. 2018-05-07 15:00:18 +00:00
Adam Greig 96118d370d Use core::time::Duration. Closes #182.
Duration is now in core, so we can use that instead of conditional
compilation on std and std::time::Duration.

Closes: #189
Approved by: whitequark
2018-04-11 07:24:32 +08:00
Dan Robertson 8b0ab0dc94 time: Improve time types
- Correct from_system_time implementation
 - Add missing functions and implementations to Instant type
 - Add missing frnction to Duration type

Closes: #141
Approved by: whitequark
2018-02-16 10:44:02 +08:00
Dan Robertson 7edb7ee93d Implement the time module. 2018-01-13 14:51:21 +00:00