This commit is contained in:
shimun 2020-02-16 23:50:59 +01:00
parent aaf2bce03c
commit c112dd7407
Signed by: shimun
GPG Key ID: E81D8382DC2F971B

View File

@ -1,24 +1,17 @@
use crate::pgp::KnownKeys;
use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt};
use crate::chacha_io::{ChaChaReader, ChaChaWriter};
use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt};
use chrono::*;
use core::cell::RefCell;
use iron::method::Method;
use iron::modifiers::Redirect;
use iron::prelude::*;
use iron::url::Url;
use rand::Rng;
use sha2::{Digest, Sha256};
use std::borrow::BorrowMut;
use std::convert::TryInto;
use std::fs;
use std::fs::File;
use std::io;
use std::io::prelude::*;
use std::iter::Iterator;
use std::path::{Path, PathBuf};
use std::sync::Mutex;
use std::sync::Arc;
pub struct Snippet<'a> {
pub id: String,
@ -87,7 +80,7 @@ impl<'a> Snippet<'a> {
hdl.read_exact(&mut comp)?;
let comp = String::from_utf8(comp).unwrap();
Ok(SnippetMeta {
created: Utc.timestamp_millis(timestamp),
created: Utc.timestamp(timestamp, 0),
compression: Some(comp).filter(|_| comp_len > 0),
})
}
@ -158,4 +151,3 @@ impl<'a> SnippetStorage<'a> {
}
}
}