When generating a new FileID, use the FileHash type

This commit is contained in:
Matthias Beyer 2015-12-21 19:32:05 +01:00
parent 62150c5a61
commit fab2dece59
1 changed files with 4 additions and 1 deletions

View File

@ -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);
}
}