changeset 92:b5d670aed9a0

Formatting
author Thomas Krause <krauseto@hu-berlin.de>
date Mon, 24 Feb 2020 11:17:26 +0100
parents 1fa0d7075169
children edebaa08a0f0
files src/cache.rs src/cmp.rs src/table_reader.rs src/types.rs
diffstat 4 files changed, 8 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/cache.rs	Mon Feb 24 11:15:30 2020 +0100
+++ b/src/cache.rs	Mon Feb 24 11:17:26 2020 +0100
@@ -152,7 +152,6 @@
     }
 }
 
-
 pub type CacheKey = [u8; 16];
 pub type CacheID = u64;
 type CacheEntry<T> = (T, LRUHandle<CacheKey>);
@@ -238,7 +237,6 @@
     }
 }
 
-
 // The compiler does not automatically derive Send and Sync for Cache because it contains
 // raw pointers.
 // These raw pointers are only pointing to the elements hold in the same cache and insertion
--- a/src/cmp.rs	Mon Feb 24 11:15:30 2020 +0100
+++ b/src/cmp.rs	Mon Feb 24 11:17:26 2020 +0100
@@ -2,7 +2,7 @@
 
 /// Comparator trait, supporting types that can be nested (i.e., add additional functionality on
 /// top of an inner comparator)
-pub trait Cmp : Sync +  Send {
+pub trait Cmp: Sync + Send {
     /// Compare to byte strings, bytewise.
     fn cmp(&self, _: &[u8], _: &[u8]) -> Ordering;
 
--- a/src/table_reader.rs	Mon Feb 24 11:15:30 2020 +0100
+++ b/src/table_reader.rs	Mon Feb 24 11:17:26 2020 +0100
@@ -421,10 +421,10 @@
 
         // index/metaindex blocks are not cached. That'd be a waste of memory.
         assert_eq!(opt.block_cache.read().expect(LOCK_POISONED).count(), 0);
-    
+
         iter.next();
         assert_eq!(opt.block_cache.read().expect(LOCK_POISONED).count(), 1);
-    
+
         // This may fail if block parameters or data change. In that case, adapt it.
         iter.next();
         iter.next();
@@ -618,7 +618,10 @@
             assert_eq!(Ok(Some(v)), r);
         }
 
-        assert_eq!(table.opt.block_cache.read().expect(LOCK_POISONED).count(), 3);
+        assert_eq!(
+            table.opt.block_cache.read().expect(LOCK_POISONED).count(),
+            3
+        );
 
         // test that filters work and don't return anything at all.
         assert!(table.get(b"aaa").unwrap().is_none());
--- a/src/types.rs	Mon Feb 24 11:15:30 2020 +0100
+++ b/src/types.rs	Mon Feb 24 11:17:26 2020 +0100
@@ -10,7 +10,7 @@
 use std::sync::Arc;
 use std::sync::RwLock;
 
-pub trait RandomAccess : Send + Sync {
+pub trait RandomAccess: Send + Sync {
     fn read_at(&self, off: usize, dst: &mut [u8]) -> Result<usize>;
 }