From a5894ff91da1f553419031c064671202f2c977ac Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Sun, 29 Oct 2017 18:23:34 -0700 Subject: squelch some 'unused' warnings --- src/drive.rs | 20 ++++++++++---------- src/protocol.rs | 3 ++- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/drive.rs b/src/drive.rs index 9c67029..dbebffc 100644 --- a/src/drive.rs +++ b/src/drive.rs @@ -26,14 +26,14 @@ impl DatDrive { /// Path should be the complete path (eg, ending in '/.dat/'), not an enclosing directory /// containing files. pub fn open>(path: P, writable: bool) -> Result { - let mdrive = SleepDirRegister::open(path.as_ref(), "metadata", writable)?; - if mdrive.len()? == 0 { + let metadata = SleepDirRegister::open(path.as_ref(), "metadata", writable)?; + if metadata.len()? == 0 { bail!("Expected at least one entry (Index) in metadata register"); } - let cdrive = SleepDirRegister::open(path.as_ref(), "content", writable)?; + let content = SleepDirRegister::open(path.as_ref(), "content", writable)?; Ok(DatDrive { - metadata: mdrive, - content: cdrive, + metadata, + content, }) } } @@ -61,26 +61,26 @@ impl<'a> DatDrive { unimplemented!() } - pub fn file_metadata>(&mut self, path: P) -> Result { + pub fn file_metadata>(&mut self, _path: P) -> Result { unimplemented!() } - pub fn create_file_bytes>(&mut self, path: P, stat: &Stat, data: &[u8]) -> Result<()> { + pub fn create_file_bytes>(&mut self, _path: P, _stat: &Stat, _data: &[u8]) -> Result<()> { unimplemented!() } - pub fn create_file, R: Read>(&mut self, path: P, stat: &Stat, source: R) -> Result<()> { + pub fn create_file, R: Read>(&mut self, _path: P, _stat: &Stat, _source: R) -> Result<()> { unimplemented!() } /// Copies Stat metadata and all content from a file in the "real" filesystem into the /// DatDrive. - pub fn import_file, Q: AsRef>(&mut self, source: P, dest: Q) -> Result<()> { + pub fn import_file, Q: AsRef>(&mut self, _source: P, _dest: Q) -> Result<()> { unimplemented!() } /// Copies a file from the drive to the "real" filesystem, preserving Stat metadata. - pub fn export_file, Q: AsRef>(&mut self, source: P, dest: Q) -> Result<()> { + pub fn export_file, Q: AsRef>(&mut self, _source: P, _dest: Q) -> Result<()> { unimplemented!() } diff --git a/src/protocol.rs b/src/protocol.rs index a52c377..e6bc0f3 100644 --- a/src/protocol.rs +++ b/src/protocol.rs @@ -130,7 +130,8 @@ fn test_bsxii_continued() { assert_eq!(a, c); } -fn make_discovery_key(key: &[u8]) -> Vec { +// TODO: move to lib.rs? +pub fn make_discovery_key(key: &[u8]) -> Vec { // calculate discovery key let mut discovery_key = [0; 32]; let mut hash = Blake2b::new_keyed(32, key); -- cgit v1.2.3