1
0
Fork 0
mirror of https://github.com/dani-garcia/vaultwarden.git synced 2025-06-19 01:40:08 +00:00

Solved some warnings

This commit is contained in:
Daniel García 2018-02-15 00:53:11 +01:00
parent b54684b677
commit 31bf2bc2b1
15 changed files with 31 additions and 57 deletions

View file

@ -31,14 +31,11 @@ impl Attachment {
pub fn to_json(&self) -> JsonValue {
use util::get_display_size;
use CONFIG;
// TODO: Change all references to localhost (maybe put it in .env?)
let host = "http://localhost:8000";
let web_path = format!("{}/attachments/{}/{}", host, self.cipher_uuid, self.id);
let file_path = self.get_file_path();
let display_size = get_display_size(self.file_size);
json!({

View file

@ -1,5 +1,4 @@
use chrono::{NaiveDate, NaiveDateTime, Utc};
use time::Duration;
use chrono::{NaiveDateTime, Utc};
use serde_json::Value as JsonValue;
use uuid::Uuid;

View file

@ -1,8 +1,4 @@
use chrono::{NaiveDate, NaiveDateTime, Utc};
use time::Duration;
use serde_json::Value as JsonValue;
use uuid::Uuid;
use chrono::{NaiveDateTime, Utc};
use super::User;

View file

@ -1,5 +1,4 @@
use chrono::{NaiveDate, NaiveDateTime, Utc};
use time::Duration;
use chrono::{NaiveDateTime, Utc};
use serde_json::Value as JsonValue;
use uuid::Uuid;

View file

@ -1,5 +1,4 @@
use chrono::{NaiveDate, NaiveDateTime, Utc};
use time::Duration;
use chrono::{NaiveDateTime, Utc};
use serde_json::Value as JsonValue;
use uuid::Uuid;
@ -100,7 +99,7 @@ impl User {
let decoded_secret = match BASE32.decode(totp_secret.as_bytes()) {
Ok(s) => s,
Err(e) => return false
Err(_) => return false
};
let generated = totp_raw_now(&decoded_secret, 6, 0, 30, &HashType::SHA1);