18 Commits

Author SHA1 Message Date
Jason Volk
30a08ff7be various identifiers macro optimizations
Signed-off-by: Jason Volk <jason@zemos.net>
2024-12-28 23:43:56 +00:00
Hubert Chathi
4c00bd010d
Also use Duration and UNIX_TIME from web-time crate 2024-03-21 15:20:03 +01:00
Damir Jelić
ccd3b81557
Use web-time to return a SystemTime that works under WASM
The `MilliSecondsSinceUnixEpoch::to_system_time()` method returns the
`SystemTime` type from the standard library.

The `std::time::SystemTime::elapsed()` method sadly panics under WASM.
Instead of returning the `SystemTime` from the standard library we're
now returning a drop-in replacement of this type coming from the web-time
crate.
2024-03-20 12:19:18 +01:00
Jonas Platte
95707b86c3 Provide a more helpful Debug impl for timestamps 2024-03-16 00:23:31 +01:00
Kévin Commaille
e58b9fcd92 tests: Remove unnecessary borrows 2023-02-06 19:11:06 +01:00
Jonas Platte
1249dda583
common: Implement Debug manually for [Milli]SecondsSinceUnixEpoch 2023-02-02 12:10:29 +01:00
Kévin Commaille
63ec3a43aa common: Split test assertions 2022-06-07 12:07:57 +02:00
Jonas Platte
5f902851af
Upgrade to Rust 2021 2022-05-27 12:04:23 +02:00
Jonas Platte
b34bfaf1f6
Replace matches crate with assert_matches 2022-05-24 18:07:29 +02:00
Jonas Platte
eae7fa0a7d common: Replace unwrap with expect in (Milli)SecondsSinecUnixEpoch constructors 2022-04-21 17:16:02 +02:00
Jonas Platte
dc692e7c16 common: Add support for obtaining the system time in wasm + JS environments 2022-04-21 17:16:02 +02:00
Jonas Platte
d32d60c868 common: Add SecondsSinceUnixEpoch::now 2022-04-21 17:16:02 +02:00
Jonas Platte
733823ea3c common: Improve docs for MilliSecondsSinceUnixEpoch::now 2022-04-21 17:16:02 +02:00
Jonas Platte
215cb35806
Clean up import grouping / ordering 2022-02-18 11:20:39 +01:00
Devin Ragotzy
626b5a5d06
common: Make all pub structs non_exhaustive 2021-06-18 11:00:35 +00:00
Julian Sparber
8a147f08d1
ruma-common: Add getters to [Milli]SecondsSinceUnixEpoch 2021-05-21 15:37:39 +00:00
Jonas Platte
4dd9baa238
Improve consistency in docs 2021-05-16 23:38:19 +02:00
Jonas Platte
c34d570fff
common: Introduce SecondsSinceUnixEpoch, MilliSecondsSinceUnixEpoch 2021-05-13 01:06:04 +02:00