diff options
author | Katharina Fey <kookie@spacekookie.de> | 2017-12-26 17:22:04 +0100 |
---|---|---|
committer | Katharina Fey <kookie@spacekookie.de> | 2017-12-26 17:22:04 +0100 |
commit | b029e84f7298fe949fa3281f6bf9cf34720c859d (patch) | |
tree | 4b78fc7c6913cd92e13cf8df2ab8968f9e7c696f /src | |
parent | cef4c53ec49fa09a2e529a2212a8f0e9515aee3c (diff) |
Moving the fields to the header (where they belong?)
Diffstat (limited to 'src')
-rw-r--r-- | src/record/mod.rs | 8 | ||||
-rw-r--r-- | src/security/aes.rs | 2 | ||||
-rw-r--r-- | src/security/keys.rs | 3 | ||||
-rw-r--r-- | src/security/mod.rs | 2 |
4 files changed, 7 insertions, 8 deletions
diff --git a/src/record/mod.rs b/src/record/mod.rs index f3ceefe..19ae317 100644 --- a/src/record/mod.rs +++ b/src/record/mod.rs @@ -24,7 +24,7 @@ pub struct Header { pub name: String, pub category: String, pub tags: Vec<String>, - // pub fields: BTreeMap<String, Payload>, + pub fields: BTreeMap<String, Payload>, pub date_created: DateTime<Local>, pub date_updated: DateTime<Local>, } @@ -32,7 +32,7 @@ pub struct Header { #[derive(Debug, Serialize, Deserialize)] pub struct Record { pub header: Header, - pub fields: BTreeMap<String, Payload>, + // pub fields: BTreeMap<String, Payload>, pub body: BTreeMap<String, Payload>, } @@ -45,7 +45,7 @@ impl Header { name: name, category: category, tags: Vec::new(), - // fields: BTreeMap::new(), + fields: BTreeMap::new(), date_created: Local::now(), date_updated: Local::now(), }; @@ -66,7 +66,7 @@ impl Record { pub fn new(name: &str, category: &str) -> Record { return Record { header: Header::new(String::from(name), String::from(category)), - fields: BTreeMap::new(), + // fields: BTreeMap::new(), body: BTreeMap::new(), }; } diff --git a/src/security/aes.rs b/src/security/aes.rs index 74c1663..a229dc2 100644 --- a/src/security/aes.rs +++ b/src/security/aes.rs @@ -105,4 +105,4 @@ impl AES { fn vec_to_str(vec: &[u8]) -> String { return unsafe { String::from(from_utf8_unchecked(vec)) }; } -}
\ No newline at end of file +} diff --git a/src/security/keys.rs b/src/security/keys.rs index 86baf08..6b33889 100644 --- a/src/security/keys.rs +++ b/src/security/keys.rs @@ -6,7 +6,6 @@ use std::fs::File; use std::ffi::OsStr; use std::io::prelude::*; -use serde::{Serialize, Deserialize}; use super::random; use super::encoding; @@ -51,4 +50,4 @@ pub fn generate_key() -> Key { k.clone_from_slice(&key); return Key { data: k }; -}
\ No newline at end of file +} diff --git a/src/security/mod.rs b/src/security/mod.rs index f9365ed..ad757c9 100644 --- a/src/security/mod.rs +++ b/src/security/mod.rs @@ -15,4 +15,4 @@ pub mod keys; // Core cryptography pub mod aes; pub mod encryption; -pub use self::encryption::*;
\ No newline at end of file +pub use self::encryption::*; |