diff options
author | Alan Somers <asomers@gmail.com> | 2021-07-24 16:47:26 -0600 |
---|---|---|
committer | Alan Somers <asomers@gmail.com> | 2021-07-24 18:25:44 -0600 |
commit | 86acc26cbcadfd572d6af93ba34467a3cdac8b4e (patch) | |
tree | e4d378d4a648259bf782262fd90c7a5709d67b77 /src/sys/time.rs | |
parent | e88a6cf2ec0b6bd042641f58618d6e72e2c624c4 (diff) | |
download | nix-86acc26cbcadfd572d6af93ba34467a3cdac8b4e.zip |
Constify many functions
Constify most functions that can be constified. The exceptions are
mostly accessors for structs that have no const constructor.
Diffstat (limited to 'src/sys/time.rs')
-rw-r--r-- | src/sys/time.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/sys/time.rs b/src/sys/time.rs index c786500a..ac424718 100644 --- a/src/sys/time.rs +++ b/src/sys/time.rs @@ -187,11 +187,11 @@ impl TimeSpec { } #[cfg_attr(target_env = "musl", allow(deprecated))] // https://github.com/rust-lang/libc/issues/1848 - pub fn tv_sec(&self) -> time_t { + pub const fn tv_sec(&self) -> time_t { self.0.tv_sec } - pub fn tv_nsec(&self) -> timespec_tv_nsec_t { + pub const fn tv_nsec(&self) -> timespec_tv_nsec_t { self.0.tv_nsec } @@ -404,11 +404,11 @@ impl TimeVal { } #[cfg_attr(target_env = "musl", allow(deprecated))] // https://github.com/rust-lang/libc/issues/1848 - pub fn tv_sec(&self) -> time_t { + pub const fn tv_sec(&self) -> time_t { self.0.tv_sec } - pub fn tv_usec(&self) -> suseconds_t { + pub const fn tv_usec(&self) -> suseconds_t { self.0.tv_usec } } |