vec_map 0.0.1

Pulling VecMap out of the std library, so you can use it in beta
Documentation
b0VIM 7.4��FU�8L?npmchrubuntu~npm/src/Workspace/Rust/Math/expr/src/vec_map/src/lib.rsutf-8
3210#"! UtpC=G_�z�6q@�w�
UJ	}�
Lk"Q�[�[�ad
2	C�{XU��M)(�
�
�
�
�
�
�
x
j
K

������xteaY:�����rLFB�
�
�
�
�
�
n
F



�	�	�	�	�	�	�	N	M	2	#			����}K'%$������vH#�����rd421������tA���G*��������wTL91%���kP    #[stable(feature = "rus    #[stable(feature = "rust1", since = "1.0.0")]    /// ```    /// let mut map: VecMap<&str> = VecMap::new();    /// use std::collections::VecMap;    /// # #![feature(collections)]    /// ```    ///    /// # Examples    ///    /// Creates an empty `VecMap`.impl<V> VecMap<V> {}    }        count.hash(state);        }            count += 1;            elt.hash(state);        for elt in self {        let mut count: usize = 0;        // during iteration.        // In order to not traverse the `VecMap` twice, count the elements    fn hash<H: Hasher>(&self, state: &mut H) {impl<V: Hash> Hash for VecMap<V> {#[stable(feature = "rust1", since = "1.0.0")]}    }        self.v.clone_from(&source.v);    fn clone_from(&mut self, source: &VecMap<V>) {    #[inline]    }        VecMap { v: self.v.clone() }    fn clone(&self) -> VecMap<V> {    #[inline]impl<V:Clone> Clone for VecMap<V> {#[stable(feature = "rust1", since = "1.0.0")]}    fn default() -> VecMap<V> { VecMap::new() }    #[inline]    #[stable(feature = "rust1", since = "1.0.0")]impl<V> Default for VecMap<V> {#[stable(feature = "rust1", since = "1.0.0")]}    index: usize,    map: &'a mut VecMap<V>,pub struct OccupiedEntry<'a, V:'a> {#[stable(feature = "rust1", since = "1.0.0")]/// An occupied Entry.}    index: usize,    map: &'a mut VecMap<V>,pub struct VacantEntry<'a, V:'a> {#[stable(feature = "rust1", since = "1.0.0")]/// A vacant Entry.}    Occupied(OccupiedEntry<'a, V>),    #[stable(feature = "rust1", since = "1.0.0")]    /// An occupied Entry    Vacant(VacantEntry<'a, V>),    #[stable(feature = "rust1", since = "1.0.0")]    #[stable(feature = pub enum Entry<'a, V:ppub enum Entpub enum Entry<pub enum Entry<'a, V:'a> {/// A view into a single entry in a map, which may either be vacant or occupied.}    v: Vec<Option<V>>,pub struct VecMap<V> {/// ```/// assert!(months.is_empty());/// months.clear();////// }///     println!("month {} is {}", key, value);/// for (key, value) in months.iter() {/// // Print out all months////// assert_eq!(months.get(&3), Some(&"Venus"));////// }///     *value = "Venus";/// if let Some(value) = months.get_mut(&3) {////// assert_eq!(months.get(&1), Some(&"Jan"));////// }///     println!("The end is near!");/// if !months.contains_key(&12) {////// months.insert(3, "Mar");/// months.insert(2, "Feb");/// months.insert(1, "Jan");/// let mut months = VecMap::new();////// use std::collections::VecMap;/// # #![feature(collections)]/// ```////// # Examples////// A map optimized for small integer keys.use std::slice;use std::vec::{self, Vec};use std::ops::{Index, IndexMut};use std::mem::{replace, swap};use std::iter::{Enumerate, FilterMap, Map, FromIterator};use std::hash::{Hash, Hasher};use std::fmt;use std::cmp::max;use self::Entry::*;#![allow(missing_docs)]//! are O(highest integer key).//! A simple map based on a vector for small integer keys. Space requirements// except according to those terms.// option. This file may not be copied, modified, or distributed// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or//// http://rust-lang.org/COPYRIGHT.// file at the top-level directory of this distribution and at// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHTad�Q����jE6���~|{D�
�
�
�
�
�
�
s
Z
E

�������VTS+��~}J�
�
�
�
�
�
�
|
0
.
�	�	�	�	�	r	q	2	���gedA%$���f��^����N"�}    fn next_bac}    fn next_back(&mut self)}    fn next_back(&mut self)}    fn next_b}    fn next_back(&mut self) -}    fn next_back(&m}    fn next_back(&mut s}    f}    fn next_back(&mut self) -> Op}    fn next_back(&mut self) -> Option<(usize, V)}   }    fn next_back(&mut self) -> Op}    fn next_back(&mut self) -> Option<(usize, V)> }    fn ne}    fn next_back(&mut self) -> Op}    fn next_back(&mut self) -> Option<(usize}    fn next_back(&mut self) -> Opti}    fn next_back(&mut self) -> Opti}    fn next_back(&mut self) -}    fn next_back(&mut self) -> Option<(usize, V)> { self.iter.next_back() }impl<V> DoubleEndedIterator for IntoIter<V> {}    fn size_hint(&self) -> (usize, Option<usize>) { self.iter.size_hint() }    fn next(&mut self) -> Option<(usize, V)> { self.iter.next() }    type Item = (usize, V);impl<V> Iterator for IntoIter<V> {}    fn next_back(&mut self) -> Option<(&'a V)> { self.iter.next_back() }impl<'a, V> DoubleEndedIterator for Values<'a, V> {}    fn size_hint(&self) -> (usize, Option<usize>) { self.iter.size_hint() }    fn next(&mut self) -> Option<(&'a V)> { self.iter.next() }    type Item = &'a V;impl<'a, V> Iterator for Values<'a, V> {}    fn next_back(&mut self) -> Option<usize> { self.iter.next_back() }impl<'a, V> DoubleEndedIterator for Keys<'a, V> {}    fn size_hint(&self) -> (usize, Option<usize>) { self.iter.size_hint() }    fn next(&mut self) -> Option<usize> { self.iter.next() }    type Item = usize;impl<'a, V> Iterator for Keys<'a, V> {*/}    fn next_back(&mut self) -> Option<(usize, V)> { self.iter.next_back() }impl<'a, V> DoubleEndedIterator for Drain<'a, V> {}    fn size_hint(&self) -> (usize, Option<usize>) { self.iter.size_hint() }    fn next(&mut self) -> Option<(usize, V)> { self.iter.next() }    type Item = (usize, V);impl<'a, V> Iterator for Drain<'a, V> {}    fn((usize, Option<V>)) -> Option<(usize, V)>>    Enumerate<vec::Drain<'a, Option<V>>>,    iter: FilterMap<pub struct Drain<'a, V:'a> {/*}    fn((usize, Option<V>)) -> Option<(usize, V)>>    Enumerate<vec::IntoIter<Option<V>>>,    iter: FilterMap<pub struct IntoIter<V> {/// A consuming iterator over the key-value pairs of a map.}    }        }            iter: self.iter.clone()        Values {    fn clone(&self) -> Values<'a, V> {impl<'a, V> Clone for Values<'a, V> {// FIXME(#19839) Remove in favor of `#[derive(Clone)]`}    iter: Map<Iter<'a, V>, fn((usize, &'a V)) -> &'a V>pub struct Values<'a, V: 'a> {/// An iterator over the values of a map.}    }        }            iter: self.iter.clone()        Keys {    fn clone(&self) -> Keys<'a, V> {impl<'a, V> Clone for Keys<'a, V> {// FIXME(#19839) Remove in favor of `#[derive(Clone)]`}    iter: Map<Iter<'a, V>, fn((usize, &'a V)) -> usize>ad��_����}uiF ���e_^�
�
�
�
�
�
N
'



����q!����}uiF �
�
�
�
i
E
)
�	�	�	�	�	0			�_&���{X1%���zpji���65��I�����X.���l@
    }        Values { iter: self.iter().map(second) }      }        Values { iter: self.iter().ma    }        Values { iter: self.iter().map(second) }    }     }        Values { iter: self.i    }        Values { iter: self.iter(    }        Values { iter: self.iter().map(second)    }        Values { iter: self.iter().    }        Values { iter: self.iter().map(secon    }        Values { iter: self.iter().map(second) }        let second: fn((usize, &'r V)) -> &'r V = second; // coerce to fn pointer        fn second<A, B>((_, b): (A, B)) -> B { b }        pub fn values<'r>(&'r self) -> Values<'r, V> {    /// The iterator's element type is `&'r V`.    /// Returns an iterator visiting all values in ascending order of the keys.    }        Keys { iter: self.iter().map(first) }        let first: fn((usize, &'r V)) -> usize = first; // coerce to fn pointer        fn first<A, B>((a, _): (A, B)) -> A { a }        pub fn keys<'r>(&'r self) -> Keys<'r, V> {    /// The iterator's element type is `usize`.    /// Returns an iterator visiting all keys in ascending order of the keys.    }        }            self.v.reserve_exact(len - cur_len);        if len >= cur_len {        let cur_len = self.v.len();        pub fn reserve_len_exact(&mut self, len: usize) {    /// ```    /// assert!(map.capacity() >= 10);    /// map.reserve_len_exact(10);    /// let mut map: VecMap<&str> = VecMap::new();    /// use std::collections::VecMap;    /// # #![feature(collections)]    /// ```    ///    /// # Examples    ///    /// `reserve_len` if future insertions are expected.    /// Therefore capacity cannot be relied upon to be precisely minimal.  Prefer    /// Note that the allocator may give the collection more space than it requests.    ///    /// keys are less than `len`.    /// In the case of `VecMap` this means reallocations will not occur as long as all inserted    /// Reserves the minimum capacity for the given `VecMap` to contain `len` distinct keys.    }        }            self.v.reserve(len - cur_len);        if len >= cur_len {        let cur_len = self.v.len();        pub fn reserve_len(&mut self, len: usize) {    /// ```    /// assert!(map.capacity() >= 10);    /// map.reserve_len(10);    /// let mut map: VecMap<&str> = VecMap::new();    /// use std::collections::VecMap;    /// # #![feature(collections)]    /// ```    ///    /// # Examples    ///    /// The collection may reserve more space to avoid frequent reallocations.    ///    /// as all inserted keys are less than `len`.    /// In the case of `VecMap` this means reallocations will not occur as long    /// Reserves capacity for the given `VecMap` to contain `len` distinct keys.    }        self.v.capacity()        pub fn capacity(&self) -> usize {    #[inline]    /// ```    /// assert!(map.capacity() >= 10);    /// let map: VecMap<String> = VecMap::with_capacity(10);    /// use std::collections::VecMap;    /// # #![feature(collections)]    /// ```    ///    /// # Examples    ///    /// reallocating.    /// Returns the number of elements the `VecMap` can hold without    }        VecMap { v: Vec::with_capacity(capacity) }        pub fn with_capacity(capacity: usize) -> VecMap<V> {    /// ```    /// let mut map: VecMap<&str> = VecMap::with_capacity(10);    /// use std::collections::VecMap;    /// # #![feature(collections)]    /// ```    ///    /// # Examples    ///    /// elements before resizing.    /// Creates an empty `VecMap` with space for at least `capacity`ad`dz�nfSK?�����um=�
�
�
�
�
z
Z
:
0
*
)
��d\IA5�����kc6
�
�
�
�
h
V
@
 
�	�	�	�	�	�	�	s	k	_	<			�����rXP6.����rf5��t1)������woL2������vnO0$�����d��R//            swap(self, &mut other);            swap(self, &mut other);                     s            swap(self, &mut other);                swap(self, &mut other);            // Move all elements to oth            swap(self, &mut other);                swap(self, &mut other);            // Mov                   swap(self, &mut other);            // Move all elements to other        if at == 0 {        let mut other = VecMap::new();    pub fn split_off(&mut self, at: usize) -> Self {    /// ```    /// assert_eq!(b[4], "d");    /// assert_eq!(b[3], "c");    ///    /// assert_eq!(a[2], "b");    /// assert_eq!(a[1], "a");    ///    /// let b = a.split_off(3);    ///    /// a.insert(4, "d");    /// a.insert(3, "c");    /// a.insert(2, "b");    /// a.insert(1, "a");    /// let mut a = VecMap::new();    ///    /// use std::collections::VecMap;    /// # #![feature(collections)]    /// ```    ///    /// # Examples    ///    /// Note that the capacity of `self` does not change.    ///    /// and the returned `Self` contains elements `[at, max_key)`.    /// Returns a newly allocated `Self`. `self` contains elements `[0, at)`,    ///    /// Splits the collection into two at the given key.    */    }        self.extend(other.drain());    pub fn append(&mut self, other: &mut Self) {    /// ```    /// assert_eq!(a[4], "d");    /// assert_eq!(a[3], "c");    /// assert_eq!(a[2], "b");    /// assert_eq!(a[1], "a");    /// assert_eq!(b.len(), 0);    /// assert_eq!(a.len(), 4);    ///    /// a.append(&mut b);    ///    /// b.insert(4, "d");    /// b.insert(3, "c");    /// let mut b = VecMap::new();    ///    /// a.insert(2, "b");    /// a.insert(1, "a");    /// let mut a = VecMap::new();    ///    /// use std::collections::VecMap;    /// # #![feature(collections)]    /// ```    ///    /// # Examples    ///    /// Moves all elements from `other` into the map while overwriting existing keys.    /*    }        }            iter: self.v.iter_mut()            back: self.v.len(),            front: 0,        IterMut {        pub fn iter_mut<'r>(&'r mut self) -> IterMut<'r, V> {    /// ```    /// }    ///     assert_eq!(value, &"x");    /// for (key, value) in map.iter() {    ///    /// }    ///     *value = "x";    /// for (key, value) in map.iter_mut() {    ///    /// map.insert(3, "c");    /// map.insert(2, "b");    /// map.insert(1, "a");    /// let mut map = VecMap::new();    ///    /// use std::collections::VecMap;    /// # #![feature(collections)]    /// ```    ///    /// # Examples    ///    /// The iterator's element type is `(usize, &'r mut V)`.    /// with mutable references to the values.    /// Returns an iterator visiting all key-value pairs in ascending order of the keys,    }        }            iter: self.v.iter()            back: self.v.len(),            front: 0,        Iter {        pub fn iter<'r>(&'r self) -> Iter<'r, V> {    /// ```    /// }    ///     println!("{}: {}", key, value);    /// for (key, value) in map.iter() {    /// // Print `1: a` then `2: b` then `3: c`    ///    /// map.insert(2, "b");    /// map.insert(3, "c");    /// map.insert(1, "a");    /// let mut map = VecMap::new();    ///    /// use std::collections::VecMap;    /// # #![feature(collections)]    /// ```    ///    /// # Examples    ///    /// The iterator's element type is `(usize, &'r V)`.    /// Returns an iterator visiting all key-value pairs in ascending order of the keys.ad, 	6����zyA����eG9.-�
�
�
e





��e�������aE)
�
�
�
{
F
�	�	�	v	u	-	'	 	�rjWOC �����ui7������|pM'�����e@
������\T1���xw4,����sF    /// ```    /// assert_eq!(map.get(&2), None);    /// assert_eq!(map.get(&1), Some(&"a"));    /// map.insert(1, "a");    /// let mut map = VecMap::new();    ///    /// use std::collections::VecMap;    /// # #![feature(collections)]    /// ```    ///    /// # Examples    ///    /// Returns a reference to the value corresponding to the key.    pub fn clear(&mut self) { self.v.clear() }    #[stable(feature = "rust1", since = "1.0.0")]    /// ```    /// assert!(a.is_empty());    /// a.clear();    /// a.insert(1, "a");    /// let mut a = VecMap::new();    ///    /// use std::collections::VecMap;    /// # #![feature(collections)]    /// ```    ///    /// # Examples    ///    /// Clears the map, removing all key-value pairs.    }        self.v.iter().all(|elt| elt.is_none())    pub fn is_empty(&self) -> bool {    #[stable(feature = "rust1", since = "1.0.0")]    /// ```    /// assert!(!a.is_empty());    /// a.insert(1, "a");    /// assert!(a.is_empty());    /// let mut a = VecMap::new();    ///    /// use std::collections::VecMap;    /// # #![feature(collections)]    /// ```    ///    /// # Examples    ///    /// Returns true if the map contains no elements.    }        self.v.iter().filter(|elt| elt.is_some()).count()    pub fn len(&self) -> usize {    #[stable(feature = "rust1", since = "1.0.0")]    /// ```    /// assert_eq!(a.len(), 1);    /// a.insert(1, "a");    /// assert_eq!(a.len(), 0);    /// let mut a = VecMap::new();    ///    /// use std::collections::VecMap;    /// # #![feature(collections)]    /// ```    ///    /// # Examples    ///    /// Returns the number of elements in the map.    }        Drain { iter: self.v.drain(..).enumerate().filter_map(filter) }        let filter: fn((usize, Option<V>)      */    }        Drain { iter: self.v.drain(..).enumerate().filter_map(filter) }        let filter: fn((usize, Option<V>)) -> Option<(usize, V)> = filter; // coerce to fn ptr        }            v.map(|v| (i, v))        fn filter<A>((i, v): (usize, Option<A>)) -> Option<(usize, A)> {    pub fn drain<'a>(&'a mut self) -> Drain<'a, V> {    /// ```    /// assert_eq!(vec, [(1, "a"), (2, "b"), (3, "c")]);    ///    /// let vec: Vec<(usize, &str)> = map.drain().collect();    ///    /// map.insert(2, "b");    /// map.insert(3, "c");    /// map.insert(1, "a");    /// let mut map = VecMap::new();    ///    /// use std::collections::VecMap;    /// # #![feature(collections)]    /// ```    ///    /// # Examples    ///    /// The iterator's element type is `(usize, &'r V)`. Keeps the allocated memory for reuse.    /// the keys, emptying (but not consuming) the original `VecMap`.    /// Returns an iterator visiting all key-value pairs in ascending order of    /*    }        other        other.v.extend(self.v[start_index..].iter_mut().map(|el| el.take()));        // Move elements beginning with `start_index` from `self` into `other`        other.v.extend((0..start_index).map(|_| None));        // Fill the new VecMap with `None`s until `start_index`        };            }                return other;                // self has no elements            None => {            Some(index) => max(at, index),        let start_index = match first_index {        let first_index = self.v.iter().position(|el| el.is_some());        // Look up the index of the first non-None item        }            return other;            // No elements to copy        } else if at > self.v.len() {            return otherad�����Y>0�������c=5�
�
�
�
y
G

������|pM'�����rf4�
�
�
y
^
P
?
.
$


�	|	t	a	Y	M	*		���}uX$���bJ
���\TA9-
����lB6����^HBA������rj6.����yXL    #[st    #[stable(feature = "rust1", since = "1.0.0")]    /// ```    /// assert_eq!(count[1], 3);    ///    /// }    ///     *count.entry(x).or_insert(0) += 1;    /// for x in vec![1, 2, 1, 2, 3, 4, 1, 2, 4] {    /// // count the number of occurrences of numbers in the vec    ///    /// let mut count: VecMap<u32> = VecMap::new();    ///    /// use std::collections::VecMap;    /// # #![feature(collections)]    /// ```    ///    /// # Examples    ///    /// Gets the given key's corresponding entry in the map for in-place manipulation.    }        result.take()        let result = &mut self.v[*key];        }            return None;        if *key >= self.v.len() {    pub fn remove(&mut self, key: &usize) -> Option<V> {    #[stable(feature = "rust1", since = "1.0.0")]    /// ```    /// assert_eq!(map.remove(&1), None);    /// assert_eq!(map.remove(&1), Some("a"));    /// map.insert(1, "a");    /// let mut map = VecMap::new();    ///    /// use std::collections::VecMap;    /// # #![feature(collections)]    /// ```    ///    /// # Examples    ///    /// was previously in the map.    /// Removes a key from the map, returning the value at the key if the key    }        replace(&mut self.v[key], Some(value))        }            self.v.extend((0..key - len + 1).map(|_| None));        if len <= key {        let len = self.v.len();    pub fn insert(&mut self, key: usize, value: V) -> Option<V> {    #[stable(feature = "rust1", since = "1.0.0")]    /// ```    /// assert_eq!(map[37], "c");    /// assert_eq!(map.insert(37, "c"), Some("b"));    /// map.insert(37, "b");    ///    /// assert_eq!(map.is_empty(), false);    /// assert_eq!(map.insert(37, "a"), None);    /// let mut map = VecMap::new();    ///    /// use std::collections::VecMap;    /// # #![feature(collections)]    /// ```    ///    /// # Examples    ///    /// present in the map, that value is returned. Otherwise, `None` is returned.    /// Inserts a key-value pair into the map. If the key already had a value    }        }            None        } else {            }              None => None              Some(ref mut value) => Some(value),            match *(&mut self.v[*key]) {        if *key < self.v.len() {    pub fn get_mut(&mut self, key: &usize) -> Option<&mut V> {    #[stable(feature = "rust1", since = "1.0.0")]    /// ```    /// assert_eq!(map[1], "b");    /// }    ///     *x = "b";    /// if let Some(x) = map.get_mut(&1) {    /// map.insert(1, "a");    /// let mut map = VecMap::new();    ///    /// use std::collections::VecMap;    /// # #![feature(collections)]    /// ```    ///    /// # Examples    ///    /// Returns a mutable reference to the value corresponding to the key.    }        self.get(key).is_some()    pub fn contains_key(&self, key: &usize) -> bool {    #[stable(feature = "rust1", since = "1.0.0")]    #[inline]    /// ```    /// assert_eq!(map.contains_key(&2), false);    /// assert_eq!(map.contains_key(&1), true);    /// map.insert(1, "a");    /// let mut map = VecMap::new();    ///    /// use std::collections::VecMap;    /// # #![feature(collections)]    /// ```    ///    /// # Examples    ///    /// Returns true if the map contains a value for the specified key.    }        }            None        } else {            }              None => None              Some(ref value) => Some(value),            mat    pub fn get(&self, key: &usize) -> Option<&V> {        pub fn get(&self, key: &usize) -> Option<&V> {ad����0��tO4	�
�
�
�
�
�
�

~
}
b
:
���%���rhba9�
�
T

	
�	�	�	�	�	k		�o"
������r2���Y<643���lSML���wqp.������M"���sml'���    pub fn remove(self) ->     pub fn remove(self) -> V {    #[stable(feature = "rust1", since = "1.0.0")]    /// Takes the value of the entry out of the map, and returns it.    }        self.map.insert(index, value).unwrap()        let index = self.index;    pub fn insert(&mut self, value: V) -> V {    #[stable(feature = "rust1", since = "1.0.0")]    /// and returns the entry's old value.    /// Sets the value of the entry with the OccupiedEntry's key,    }        &mut self.map[index]        let index = self.index;    pub fn into_mut(self) -> &'a mut V {    #[stable(feature = "rust1", since = "1.0.0")]    /// Converts the entry into a mutable reference to its value.    }        &mut self.map[index]        let index = self.index;    pub fn get_mut(&mut self) -> &mut V {    #[stable(feature = "rust1", since = "1.0.0")]    /// Gets a mutable reference to the value in the entry.    }        &self.map[index]        let index = self.index;    pub fn get(&self) -> &V {    #[stable(feature = "rust1", since = "1.0.0")]    /// Gets a reference to the value in the entry.impl<'a, V> OccupiedEntry<'a, V> {}    }        &mut self.map[index]        self.map.insert(index, value);        let index = self.index;    pub fn insert(self, value: V) -> &'a mut V {    #[stable(feature = "rust1", since = "1.0.0")]    /// and returns a mutable reference to it.    /// Sets the value of the entry with the VacantEntry's key,impl<'a, V> VacantEntry<'a, V> {}    }        }            Vacant(entry) => entry.insert(default()),            Occupied(entry) => entry.into_mut(),        match self {    pub fn or_insert_with<F: FnOnce() -> V>(self, default: F) -> &'a mut V {    /// and returns a mutable reference to the value in the entry.    /// Ensures a value is in the entry by inserting the result of the default function if empty,               reason = "matches entry v3 specification, waiting for dust to settle")]    #[unstable(feature = "collections",    }        }            Vacant(entry) => entry.insert(default),            Occupied(entry) => entry.into_mut(),        match self {    pub fn or_insert(self, default: V) -> &'a mut V {    /// a mutable reference to the value in the entry.    /// Ensures a value is in the entry by inserting the default if empty, and returns               reason = "matches entry v3 specification, waiting for dust to settle")]    #[unstable(feature = "collections",    }        }            Vacant(entry) => Err(entry),            Occupied(entry) => Ok(entry.into_mut()),        match self {    pub fn get(self) -> Result<&'a mut V, VacantEntry<'a, V>> {    /// Returns a mutable reference to the entry if occupied, or the VacantEntry if vacant                reason = "replaced with more ergonomic `or_insert` and `or_insert_with`")]    #[deprecated(since = "1.0",               reason = "will soon be replaced by or_insert")]    #[unstable(feature = "collections",impl<'a, V> Entry<'a, V> {}    }        }            })                index: key,                map: self,            Vacant(VacantEntry {        } else {            })                index: key,                map: self,            Occupied(OccupiedEntry {        if self.contains_key(&key) {        // useless construct on VecMap, so it's hardly a big loss.        // completely insane to do any other way. That said, Entry is a border-line        // entry possible, because weird non-lexical borrows issues make it        // FIXME(Gan    pub fn entry(&mut self, key: usize) -> Entry<V> {        pub fn entry(&mut self, key: usize) -> Entry<V> {ad��}������S��������}|K=�
�
�
�
�
�
�
S




����U$��������L'
�
�
�
�
�
�
�
F

�	�	�	�	�	�	b	Z	5		�����WK#���SR�������eQKIH������~S
���������uE
����&��pPO    #[inline]    type Output      #[inline]    type Output = V;impl<'a,V    #[inline]    #[inline]    type Output     #[inline]    type Output = V;impl<'a,V>     #[inline]    #[inline]    type Output =    #[inline]    type Output = V;impl<'a,    #[inline]    type Output = V;impl<'a,V> In    #[inl    #[inline]    type Output = V;i     #[inlin    #[inline]    type Output = V;impl<'a,V> Index<&'a usize> for VecMap<V> {}    }        self.get(&i).expect("key not present")    fn index<'a>(&'a self, i: usize) -> &'a V {    #[inline]    type Output = V;impl<V> Index<usize> for VecMap<V> {}    }        }            self.insert(k, v);        for (k, v) in iter {    fn extend<I: IntoIterator<Item=(usize, V)>>(&mut self, iter: I) {impl<V> Extend<(usize, V)> for VecMap<V> {}    }        self.iter_mut()    fn into_iter(mut self) -> IterMut<'a, T> {    type IntoIter = IterMut<'a, T>;    type Item = (usize, &'a mut T);impl<'a, T> IntoIterator for &'a mut VecMap<T> {}    }        self.iter()    fn into_iter(self) -> Iter<'a, T> {    type IntoIter = Iter<'a, T>;    type Item = (usize, &'a T);impl<'a, T> IntoIterator for &'a VecMap<T> {}    }        IntoIter { iter: self.v.into_iter().enumerate().filter_map(filter) }        let filter: fn((usize, Option<T>)) -> Option<(usize, T)> = filter; // coerce to fn ptr        }            v.map(|v| (i, v))        fn filter<A>((i, v): (usize, Option<A>)) -> Option<(usize, A)> {    fn into_iter(self) -> IntoIter<T> {    /// ```    /// assert_eq!(vec, [(1, "a"), (2, "b"), (3, "c")]);    ///    /// let vec: Vec<(usize, &str)> = map.into_iter().collect();    ///    /// map.insert(2, "b");    /// map.insert(3, "c");    /// map.insert(1, "a");    /// let mut map = VecMap::new();    ///    /// use std::collections::VecMap;    /// # #![feature(collections)]    /// ```    ///    /// # Examples    ///    /// The iterator's element type is `(usize, &'r V)`.    /// the keys, consuming the original `VecMap`.    /// Returns an iterator visiting all key-value pairs in ascending order of    type IntoIter = IntoIter<T>;    type Item = (usize, T);impl<T> IntoIterator for VecMap<T> {}    }        map        map.extend(iter);        let mut map = VecMap::new();    fn from_iter<I: IntoIterator<Item=(usize, V)>>(iter: I) -> VecMap<V> {impl<V> FromIterator<(usize, V)> for VecMap<V> {}    }        write!(f, "}}")        }            try!(write!(f, "{}: {:?}", k, *v));            if i != 0 { try!(write!(f, ", ")); }        for (i, (k, v)) in self.iter().enumerate() {        try!(write!(f, "{{"));    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {impl<V: fmt::Debug> fmt::Debug for VecMap<V> {}*/    }        iter::order::cmp(self.iter(), other.iter())    fn cmp(&self, other: &VecMap<V>) -> Ordering {    #[inline]impl<V: Ord> Ord for VecMap<V> {}    }        iter::order::partial_cmp(self.iter(), other.iter())    fn partial_cmp(&self, other: &VecMap<V>) -> Option<Ordering> {    #[inline]/*impl<V: PartialOrd> PartialOrd for VecMap<V> {impl<V: Eq> Eq for VecMap<V> {}}    }        true        }            }                return false;            if k1 != k2 || v1 != v2 {        for ((k1, v1), (k2, v2)) in self.iter().zip(other.iter()) {    fn eq(&self, other: &VecMap<V>) -> bool {impl<V: PartialEq> PartialEq for VecMap<V> {}    }        self.map.remove(&index).unwrap()        let index = self.index;adFz�����zR:�����_-'%$�
�
j
K
J
4

��~E��jG�
�
�
�
�
v
a
S
R
<

�	�	�	�	�	�	�	L		���_-��k*����mI7"
���ra<:9����nJ@:87���oA"�����UT,��#[#[stable(feature = "rust1", since = "1.0.0")]/// An iterator over the keys of a map.double_ended_iterator! { impl IterMut -> (usize, &'a mut V), as_mut }iterator! { impl IterMut -> (usize, &'a mut V), as_mut }}    iter: slice::IterMut<'a, Option<V>>    back: usize,    front: usize,pub struct IterMut<'a, V:'a> {#[stable(feature = "rust1", since = "1.0.0")]/// values being mutable./// An iterator over the key-value pairs of a map, with thedouble_ended_iterator! { impl Iter -> (usize, &'a V), as_ref }iterator! { impl Iter -> (usize, &'a V), as_ref }}    }        }            iter: self.iter.clone()            back: self.back,            front: self.front,        Iter {    fn clone(&self) -> Iter<'a, V> {impl<'a, V> Clone for Iter<'a, V> {// FIXME(#19839) Remove in favor of `#[derive(Clone)]`}    iter: slice::Iter<'a, Option<V>>    back: usize,    front: usize,pub struct Iter<'a, V:'a> {#[stable(feature = "rust1", since = "1.0.0")]/// An iterator over the key-value pairs of a map.}    }        }            }                None                }                    self.back -= 1;                    }                        _ => ()                        }                            }                                None => {},                                },                                    return Some((self.back, x));                                    self.back -= 1;                                Some(x) => {                            match elem$(. $getter ())+ {                        Some(elem) => {                    match self.iter.next_back() {                while self.front < self.back {            fn next_back(&mut self) -> Option<$elem> {            #[inline]        impl<'a, V> DoubleEndedIterator for $name<'a, V> {        #[stable(feature = "rust1", since = "1.0.0")]    (impl $name:ident -> $elem:ty, $($getter:ident),+) => {macro_rules! double_ended_iterator {}    }        }            }                (0, Some(self.back - self.front))            fn size_hint(&self) -> (usize, Option<usize>) {            #[inline]            }                None                }                    self.front += 1;                    }                        _ => ()                        }                            }                                None => {},                                },                                    return Some((index, x));                                    self.front += 1;                                    let index = self.front;                                Some(x) => {                            match elem$(. $getter ())+ {                        Some(elem) => {                    match self.iter.next() {                while self.front < self.back {            fn next(&mut self) -> Option<$elem> {            #[inline]            type Item = $elem;        impl<'a, V> Iterator for $name<'a, V> {        #[stable(feature = "rust1", since = "1.0.0")]    (impl $name:ident -> $elem:ty, $($getter:ident),+) => {macro_rules! iterator {}    }        self.get_mut(i).expect("key not present")    fn index_mut(&mut self, i: &usize) -> &mut V {    #[inline]impl<'a, V> IndexMut<&'a usize> for VecMap<V> {#[stable(feature = "rust1", since = "1.0.0")]}    }        self.get_mut(&i).expect("key not present")    fn index_mut(&impl<Vimpl<V> IndexMut<usize> for VecMap<V> {impl<V> IndexMut<usize> for VecMap<V> {}    }        self.get(i).expect("key not present")    fn index(&self, i: &usize) -> &V {ad��	@������zTL)	����d^]'�
�
�
�
�
e
K
+

������og[8
�����\[�
�
�
�
�
�
s
W
*

�	�	�	r	q			��lB�    /// ```    /// assert_eq!(map.get(&2), No    #[stable(    #[stable(feature = "rust1", s    #[sta    #[stable(feature = "rust1", sinc    #[stable(feature = "rust1", since = "1        pub fn get(&self, key: &usize) -> Option<&V>         pub fn get(&self, key: &usize) -> Option<&V> {    /// ```    //        pub fn get(&self, key:        pu        pub fn get(&self, key: &usize) -> Option<&V> {    /// ```    /// assert_eq!(map.get(&         pub fn get(&self, key: &usize) -> Option<&V> {    /// ```    /              pub fn get(&self, key: &usize) -> Option<&V> {    /// ```    /// assert_eq!(map.get(&2), None);    /// assert_eq!(map.get(&1), Some(&"a"));    /// map.insert(1, "a");    /// let mut map = VecMap::new();    ///    /// use std::collections::VecMap;    /// # #![feature(collections)]    /// ```    ///    /// # Examples    ///    /// Returns a reference to the value corresponding to the key.        pub fn clear(&mut self) { self.v.clear() }    /// ```    /// assert!(a.is_empty());    /// a.clear();    /// a.insert(1, "a");    /// let mut a = VecMap::new();    ///    /// use std::collections::VecMap;    /// # #![feature(collections)]    /// ```    ///    /// # Examples    ///    /// Clears the map, removing all key-value pairs.    }        self.v.iter().all(|elt| elt.is_none())        pub fn is_empty(&self) -> bool {    /// ```    /// assert!(!a.is_empty());    /// a.insert(1, "a");    /// assert!(a.is_empty());    /// let mut a = VecMap::new();    ///    /// use std::collections::VecMap;    /// # #![feature(collections)]    /// ```    ///    /// # Examples    ///    /// Returns true if the map contains no elements.    }        self.v.iter().filter(|elt| elt.is_some()).count()        pub fn len(&self) -> usize {    /// ```    /// assert_eq!(a.len(), 1);    /// a.insert(1, "a");    /// assert_eq!(a.len(), 0);    /// let mut a = VecMap::new();    ///    /// use std::collections::VecMap;    /// # #![feature(collections)]    /// ```    ///    /// # Examples    ///    /// Returns the number of elements in the map.ad�{k������TF������L-,�
�
�
`
'
���L)�����jXC54�
�
�
�
�
�
�
j
.
�	�	�	o	=		��{:����}YG2$����zxw@�����~xvuC���|kCA@���{K ���#[stable(feature = "rust1", since = "1.0.0")]#[stable(feature = "rust1", since =#[stable(feature = "rust1", since = "1.0.0")]/// An iterat#[stable(feature =#[stable(feature = "rust1", #[stable(featur#[stable(feature = "rust1", sin#[stable(feature pub struct Keys<'a, V: 'a> {/// An iterator over the keys of a map.double_ended_iterator! { impl IterMut -> (usize, &'a mut V), as_mut }iterator! { impl IterMut -> (usize, &'a mut V), as_mut }}    iter: slice::IterMut<'a, Option<V>>    back: usize,    front: usize,pub struct IterMut<'a, V:'a> {/// values being mutable./// An iterator over the key-value pairs of a map, with thedouble_ended_iterator! { impl Iter -> (usize, &'a V), as_ref }iterator! { impl Iter -> (usize, &'a V), as_ref }}    }        }            iter: self.iter.clone()            back: self.back,            front: self.front,        Iter {    fn clone(&self) -> Iter<'a, V> {impl<'a, V> Clone for Iter<'a, V> {// FIXME(#19839) Remove in favor of `#[derive(Clone)]`}    iter: slice::Iter<'a, Option<V>>    back: usize,    front: usize,pub struct Iter<'a, V:'a> {/// An iterator over the key-value pairs of a map.}    }        }            }                None                }                    self.back -= 1;                    }                        _ => ()                        }                            }                                None => {},                                },                                    return Some((self.back, x));                                    self.back -= 1;                                Some(x) => {                            match elem$(. $getter ())+ {                        Some(elem) => {                    match self.iter.next_back() {                while self.front < self.back {            fn next_back(&mut self) -> Option<$elem> {            #[inline]                impl<'a, V> DoubleEndedIterator for $name<'a, V> {    (impl $name:ident -> $elem:ty, $($getter:ident),+) => {macro_rules! double_ended_iterator {}    }        }            }                (0, Some(self.back - self.front))            fn size_hint(&self) -> (usize, Option<usize>) {            #[inline]            }                None                }                    self.front += 1;                    }                        _ => ()                        }                            }                                None => {},                                },                                    return Some((index, x));                                    self.front += 1;                                    let index = self.front;                                Some(x) => {                            match elem$(. $getter ())+ {                        Some(elem) => {                    match self.iter.next() {                while self.front < self.back {            fn next(&mut self) -> Option<$elem> {            #[inline]            type Item = $elem;                impl<'a, V> Iterator for $name<'a, V> {    (impl $name:ident -> $elem:ty, $($getter:ident),+) => {macro_rules! iterator {}    }        self.get_mut(i).expect("key not present")    fn index_mut(&mut self, i: &usize) -> &mut V {    #[inline]impl<'a, V> IndexMut<&'a usize> for VecMap<V> {}    }        self.get_mut(&i).expect("key not present")    fn index_mut(&mut self, i: usize) -> &mut V {    #[inline]ad�U�j���nRC2�
�
�
�
�
�
�
�
�
A

����~}&���s?5/.�
�
<
'
�	�	�	�	�	�	�	L		����~|{X$�����X8���hba���sml'��.��L$��pN
    pub fn remove(self) -> V {    #[stable(featu    pub fn remov    pub fn remove(self) -> V {        pub fn remove(self) -> V {    #[stabl    p    pub fn remove(self) -> V {    #[stab    pub fn remove(self) -> V {    #[stable(fe    pub fn remo    pub fn remove(self) -> V {        pub fn remove(self) -> V {    /        pub fn remove(self) -> V {    /// Takes the value of t        pub fn remove(self) -> V        pub fn remove(self) -> V {    /// Takes the value of the entry out of the map, and        pub fn remove(self) -> V {    /        pub fn remove(self) -> V {    /// Takes the value of the entry out of the map,        pub fn remove(self) -> V {    /        pub fn remove(self) -> V {    /// Takes the value of the entry out of the map,        pub fn remove(self) -> V {    /// Takes the value of the entry out of the map, and returns it.    }        self.map.insert(index, value).unwrap()        let index = self.index;        pub fn insert(&mut self, value: V) -> V {    /// and returns the entry's old value.    /// Sets the value of the entry with the OccupiedEntry's key,    }        &mut self.map[index]        let index = self.index;        pub fn into_mut(self) -> &'a mut V {    /// Converts the entry into a mutable reference to its value.    }        &mut self.map[index]        let index = self.index;        pub fn get_mut(&mut self) -> &mut V {    /// Gets a mutable reference to the value in the entry.    }        &self.map[index]        let index = self.index;        pub fn get(&self) -> &V {    /// Gets a reference to the value in the entry.impl<'a, V> OccupiedEntry<'a, V> {}    }        &mut self.map[index]        self.map.insert(index, value);        let index = self.index;        pub fn insert(self, value: V) -> &'a mut V {    /// and returns a mutable reference to it.    /// Sets the value of the entry with the VacantEntry's key,impl<'a, V> VacantEntry<'a, V> {}    }        }            Vacant(entry) => entry.insert(default()),            Occupied(entry) => entry.into_mut(),        match self {    pub fn or_insert_with<F: FnOnce() -> V>(self, default: F) -> &'a mut V {    /// and returns a mutable reference to the value in the entry.    /// Ensures a value is in the entry by inserting the result of the default function if empty,    }        }            Vacant(entry) => entry.insert(default),            Occupied(entry) => entry.into_mut(),        match self {    pub fn or_insert(self, default: V) -> &'a mut V {    /// a mutable reference to the value in the entry.    /// Ensures a value is in the entry by inserting the default if empty, and returns    }        }            Vacant(entry) => Err(entry),            Occupied(entry) => Ok(entry.into_mut()),        match self {    pub fn get(self) -> Result<&'a mut V, VacantEntry<'a, V>> {    /// Returns a mutable reference to the entry if occupied, or the VacantEntry if vacantimpl<'a, V> Entry<'a, V> {}    }        }            })                index: key,                map: self,            Vacant(VacantEntry {        } else {            })                index: key,                map: self,            Occupied(OccupiedEntry {        if self.contains_key(&key) {        // useless construct on VecMap, so it's hardly a big loss.        // completely insane to do any other way. That said, Entry is a border-line        // entry possible, because weird non-lexical borrows issues make it        // FIXME(Gankro): this is basically the dumbest implementation ofad	w���ugVE;54������tlG+�
�
�
�
v
V
P
O

�������_C����g>�
�
�
�
�
�
�
b


�	�	�	�	�	�	j	;			����C#�����@�����x\-���uM710������aY%��zphG;��nI    #[stable(feature = "rust1", since    #[stable(feature = "rust1", since = "1.    #[stable(feature = "rust1", since = "1.0.0")]    /    #[stable(feature = "rust1", since = "1.0.0")]        pub fn entry(&mut self, key: usize) -> Entry<V> {    /// ```    /// assert_eq!(count[1], 3);    ///    /// }    ///     *count.entry(x).or_insert(0) += 1;    /// for x in vec![1, 2, 1, 2, 3, 4, 1, 2, 4] {    /// // count the number of occurrences of numbers in the vec    ///    /// let mut count: VecMap<u32> = VecMap::new();    ///    /// use std::collections::VecMap;    /// # #![feature(collections)]    /// ```    ///    /// # Examples    ///    /// Gets the given key's corresponding entry in the map for in-place manipulation.    }        result.take()        let result = &mut self.v[*key];        }            return None;        if *key >= self.v.len() {        pub fn remove(&mut self, key: &usize) -> Option<V> {    /// ```    /// assert_eq!(map.remove(&1), None);    /// assert_eq!(map.remove(&1), Some("a"));    /// map.insert(1, "a");    /// let mut map = VecMap::new();    ///    /// use std::collections::VecMap;    /// # #![feature(collections)]    /// ```    ///    /// # Examples    ///    /// was previously in the map.    /// Removes a key from the map, returning the value at the key if the key    }        replace(&mut self.v[key], Some(value))        }            self.v.extend((0..key - len + 1).map(|_| None));        if len <= key {        let len = self.v.len();        pub fn insert(&mut self, key: usize, value: V) -> Option<V> {    /// ```    /// assert_eq!(map[37], "c");    /// assert_eq!(map.insert(37, "c"), Some("b"));    /// map.insert(37, "b");    ///    /// assert_eq!(map.is_empty(), false);    /// assert_eq!(map.insert(37, "a"), None);    /// let mut map = VecMap::new();    ///    /// use std::collections::VecMap;    /// # #![feature(collections)]    /// ```    ///    /// # Examples    ///    /// present in the map, that value is returned. Otherwise, `None` is returned.    /// Inserts a key-value pair into the map. If the key already had a value    }        }            None        } else {            }              None => None              Some(ref mut value) => Some(value),            match *(&mut self.v[*key]) {        if *key < self.v.len() {        pub fn get_mut(&mut self, key: &usize) -> Option<&mut V> {    /// ```    /// assert_eq!(map[1], "b");    /// }    ///     *x = "b";    /// if let Some(x) = map.get_mut(&1) {    /// map.insert(1, "a");    /// let mut map = VecMap::new();    ///    /// use std::collections::VecMap;    /// # #![feature(collections)]    /// ```    ///    /// # Examples    ///    /// Returns a mutable reference to the value corresponding to the key.    }        self.get(key).is_some()        pub fn contains_key(&self, key: &usize) -> bool {    #[inline]    /// ```    /// assert_eq!(map.contains_key(&2), false);    /// assert_eq!(map.contains_key(&1), true);    /// map.insert(1, "a");    /// let mut map = VecMap::new();    ///    /// use std::collections::VecMap;    /// # #![feature(collections)]    /// ```    ///    /// # Examples    ///    /// Returns true if the map contains a value for the specified key.    }        }            None        } else {            }              None => None              Some(ref value) => Some(value),            match self.v[*key] {        if *key < self.v.len() {ad�	�
=������kjG+�������wGED �
�
�
�
�
�
\
V
T
S
0

��w]@(���������qK�
�
�
p
0
�	�	�	x	O	    #[stable(feature = "rus    #[stable(f    #[stable(feature = "rust1",     #[stab    #[stable(feature = "rust1", sinc    #[stabl    #[stable(feature = "rust1", sin    #[sta    #[stable(feature = "rust1", since    #[stable(f    #[stable(feature = "rust1",     #[stable(feature = "rust1",     #[stable(f    #[stab    #[stable(feature = "rust1", sinc    #[stabl    #[stable(feature = "ru        pub fn new() -> VecMap<V> { VecMap { v: vec![] } }    /// ```    /// let mut map: VecMap<&str> = VecMap::new();    /// use std::collections::VecMap;    /// # #![feature(collections)]    /// ```    ///    /// # Examples    ///    /// Creates an empty `VecMap`.impl<V> VecMap<V> {}    }        count.hash(state);        }            count += 1;            elt.hash(state);        for elt in self {        let mut count: usize = 0;        // during iteration.        // In order to not traverse the `VecMap` twice, count the elements    fn hash<H: Hasher>(&self, state: &mut H) {impl<V: Hash> Hash for VecMap<V> {}    }        self.v.clone_from(&source.v);    fn clone_from(&mut self, source: &VecMap<V>) {    #[inline]    }        VecMap { v: self.v.clone() }    fn clone(&self) -> VecMap<V> {    #[inline]impl<V:Clone> Clone for VecMap<V> {}    fn default() -> VecMap<V> { VecMap::new() }        #[inline]impl<V> Default for VecMap<V> {}    index: usize,    map: &'a mut VecMap<V>,pub struct OccupiedEntry<'a, V:'a> {/// An occupied Entry.}    index: usize,    map: &'a mut VecMap<V>,pub struct VacantEntry<'a, V:'a> {/// A vacant Entry.}        Occupied(OccupiedEntry<'a, V>),    /// An occupied Entry        Vacant(VacantEntry<'a, V>),    /// A vacant Entry