feat: handle typing events

This commit is contained in:
timokoesters 2020-04-12 21:12:50 +02:00
parent 3b9cadeec2
commit 3debb6203c
No known key found for this signature in database
GPG key ID: 24DA7517711A2BA4
7 changed files with 150 additions and 29 deletions

View file

@ -4,13 +4,11 @@ use std::{
time::{SystemTime, UNIX_EPOCH},
};
pub fn millis_since_unix_epoch() -> js_int::UInt {
(SystemTime::now()
pub fn millis_since_unix_epoch() -> u64 {
SystemTime::now()
.duration_since(UNIX_EPOCH)
.unwrap()
.as_millis() as u64)
.try_into()
.expect("time millis are <= MAX_SAFE_UINT")
.as_millis() as u64
}
pub fn increment(old: Option<&[u8]>) -> Option<Vec<u8>> {