diff --git a/src/snippet.rs b/src/snippet.rs index 82419d2..9282e9d 100644 --- a/src/snippet.rs +++ b/src/snippet.rs @@ -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> { } } } -