mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-06-10 04:53:54 +00:00
Use new i64::to_be_bytes and remove byteorder dep
(https://doc.rust-lang.org/stable/std/primitive.i64.html#method.to_be_bytes)
This commit is contained in:
parent
1ce2587330
commit
e0aec8d373
4 changed files with 38 additions and 50 deletions
|
@ -90,11 +90,8 @@ fn serialize_date(date: NaiveDateTime) -> Value {
|
|||
let seconds: i64 = date.timestamp();
|
||||
let nanos: i64 = date.timestamp_subsec_nanos() as i64;
|
||||
let timestamp = nanos << 34 | seconds;
|
||||
|
||||
use byteorder::{BigEndian, WriteBytesExt};
|
||||
|
||||
let mut bs = [0u8; 8];
|
||||
bs.as_mut().write_i64::<BigEndian>(timestamp).expect("Unable to write");
|
||||
|
||||
let bs = timestamp.to_be_bytes();
|
||||
|
||||
// -1 is Timestamp
|
||||
// https://github.com/msgpack/msgpack/blob/master/spec.md#timestamp-extension-type
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue