Add signature as constant

This commit is contained in:
Jeremy Soller
2016-02-25 16:33:12 -07:00
parent 1f08b76531
commit 39707bcf60
+3 -2
View File
@@ -20,6 +20,7 @@ pub struct Header {
}
impl Header {
pub const SIGNATURE: &'static [u8; 8] = b"RedoxFS\0";
pub const VERSION: u64 = 0xFFFFFFFFFFFFFFFF;
pub fn default() -> Header {
@@ -35,7 +36,7 @@ impl Header {
pub fn new(size: u64, root: u64, free: u64) -> Header {
Header {
signature: *b"RedoxFS\0",
signature: *Header::SIGNATURE,
version: Header::VERSION,
uuid: [0; 16],
size: size,
@@ -45,7 +46,7 @@ impl Header {
}
pub fn valid(&self) -> bool {
&self.signature == b"RedoxFS\0" && self.version == Header::VERSION
&self.signature == Header::SIGNATURE && self.version == Header::VERSION
}
}