From fab2dece59448dc485871b7b6b212562c26a980e Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 21 Dec 2015 19:32:05 +0100 Subject: [PATCH] When generating a new FileID, use the FileHash type --- src/storage/file/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/storage/file/mod.rs b/src/storage/file/mod.rs index 898d04b8..8fd67a26 100644 --- a/src/storage/file/mod.rs +++ b/src/storage/file/mod.rs @@ -9,9 +9,11 @@ pub mod id_type; pub mod header; pub mod hash; + use module::Module; use storage::file::id::*; use storage::file::id_type::FileIDType; +use storage::file::hash::FileHash; use super::parser::{FileHeaderParser, Parser, ParserError}; use self::header::spec::*; @@ -111,7 +113,8 @@ impl<'a> File<'a> { fn get_new_file_id() -> FileID { use uuid::Uuid; - FileID::new(FileIDType::UUID, Uuid::new_v4().to_hyphenated_string()) + let hash = FileHash::from(Uuid::new_v4().to_hyphenated_string()); + FileID::new(FileIDType::UUID, hash); } }