]> git.proxmox.com Git - rustc.git/blobdiff - src/librustc_metadata/index.rs
New upstream version 1.14.0+dfsg1
[rustc.git] / src / librustc_metadata / index.rs
index ef83251f51e8d18ed725b411528bc3b5f0516493..53e6988c756c947d33dee83c6ab4c4bef33f1c42 100644 (file)
@@ -28,9 +28,7 @@ pub struct Index {
 
 impl Index {
     pub fn new(max_index: usize) -> Index {
-        Index {
-            positions: vec![u32::MAX; max_index]
-        }
+        Index { positions: vec![u32::MAX; max_index] }
     }
 
     pub fn record(&mut self, def_id: DefId, entry: Lazy<Entry>) {
@@ -46,7 +44,9 @@ impl Index {
 
         assert!(self.positions[item] == u32::MAX,
                 "recorded position for item {:?} twice, first at {:?} and now at {:?}",
-                item, self.positions[item], position);
+                item,
+                self.positions[item],
+                position);
 
         self.positions[item] = position.to_le();
     }
@@ -67,7 +67,8 @@ impl<'tcx> LazySeq<Index> {
         let index = def_index.as_usize();
 
         debug!("Index::lookup: index={:?} words.len={:?}",
-               index, words.len());
+               index,
+               words.len());
 
         let position = u32::from_le(words[index]);
         if position == u32::MAX {
@@ -79,8 +80,9 @@ impl<'tcx> LazySeq<Index> {
         }
     }
 
-    pub fn iter_enumerated<'a>(&self, bytes: &'a [u8])
-                               -> impl Iterator<Item=(DefIndex, Lazy<Entry<'tcx>>)> + 'a {
+    pub fn iter_enumerated<'a>(&self,
+                               bytes: &'a [u8])
+                               -> impl Iterator<Item = (DefIndex, Lazy<Entry<'tcx>>)> + 'a {
         let words = &bytes_to_words(&bytes[self.position..])[..self.len];
         words.iter().enumerate().filter_map(|(index, &position)| {
             if position == u32::MAX {