@@ -693,7 +693,7 @@ impl DefaultResizePolicy {
693
693
///
694
694
/// # Example
695
695
///
696
- /// ```rust
696
+ /// ```
697
697
/// use std::collections::HashMap;
698
698
///
699
699
/// // type inference lets us omit an explicit type signature (which
@@ -731,9 +731,9 @@ impl DefaultResizePolicy {
731
731
/// ```
732
732
///
733
733
/// The easiest way to use `HashMap` with a custom type is to derive `Eq` and `Hash`.
734
- /// We must also derive `PartialEq`, this will in the future be implied by `Eq`.
734
+ /// We must also derive `PartialEq`, but this will in the future be implied by `Eq`.
735
735
///
736
- /// ```rust
736
+ /// ```
737
737
/// use std::collections::HashMap;
738
738
///
739
739
/// #[deriving(Hash, Eq, PartialEq, Show)]
@@ -1041,8 +1041,8 @@ impl<K: Hash + Eq, V> HashMap<K, V, RandomSipHasher> {
1041
1041
///
1042
1042
/// # Example
1043
1043
///
1044
- /// ```rust
1045
- /// # use std::collections::HashMap;
1044
+ /// ```
1045
+ /// use std::collections::HashMap;
1046
1046
/// let mut map: HashMap<&str, int> = HashMap::new();
1047
1047
/// ```
1048
1048
#[ inline]
@@ -1054,8 +1054,8 @@ impl<K: Hash + Eq, V> HashMap<K, V, RandomSipHasher> {
1054
1054
///
1055
1055
/// # Example
1056
1056
///
1057
- /// ```rust
1058
- /// # use std::collections::HashMap;
1057
+ /// ```
1058
+ /// use std::collections::HashMap;
1059
1059
/// let mut map: HashMap<&str, int> = HashMap::with_capacity(10u);
1060
1060
/// ```
1061
1061
#[ inline]
@@ -1072,8 +1072,8 @@ impl<K: Eq + Hash<S>, V, S, H: Hasher<S>> HashMap<K, V, H> {
1072
1072
///
1073
1073
/// # Example
1074
1074
///
1075
- /// ```rust
1076
- /// # use std::collections::HashMap;
1075
+ /// ```
1076
+ /// use std::collections::HashMap;
1077
1077
/// use std::hash::sip::SipHasher;
1078
1078
///
1079
1079
/// let h = SipHasher::new();
@@ -1095,8 +1095,8 @@ impl<K: Eq + Hash<S>, V, S, H: Hasher<S>> HashMap<K, V, H> {
1095
1095
///
1096
1096
/// # Example
1097
1097
///
1098
- /// ```rust
1099
- /// # use std::collections::HashMap;
1098
+ /// ```
1099
+ /// use std::collections::HashMap;
1100
1100
/// use std::hash::sip::SipHasher;
1101
1101
///
1102
1102
/// let h = SipHasher::new();
@@ -1120,8 +1120,8 @@ impl<K: Eq + Hash<S>, V, S, H: Hasher<S>> HashMap<K, V, H> {
1120
1120
/// This function has no effect on the operational semantics of the
1121
1121
/// hashtable, only on performance.
1122
1122
///
1123
- /// ```rust
1124
- /// # use std::collections::HashMap;
1123
+ /// ```
1124
+ /// use std::collections::HashMap;
1125
1125
/// let mut map: HashMap<&str, int> = HashMap::new();
1126
1126
/// map.reserve(10u);
1127
1127
/// ```
@@ -1292,8 +1292,8 @@ impl<K: Eq + Hash<S>, V, S, H: Hasher<S>> HashMap<K, V, H> {
1292
1292
///
1293
1293
/// # Example
1294
1294
///
1295
- /// ```rust
1296
- /// # use std::collections::HashMap;
1295
+ /// ```
1296
+ /// use std::collections::HashMap;
1297
1297
/// let mut map = HashMap::new();
1298
1298
///
1299
1299
/// // Insert 1i with key "a"
@@ -1311,8 +1311,8 @@ impl<K: Eq + Hash<S>, V, S, H: Hasher<S>> HashMap<K, V, H> {
1311
1311
///
1312
1312
/// # Example
1313
1313
///
1314
- /// ```rust
1315
- /// # use std::collections::HashMap;
1314
+ /// ```
1315
+ /// use std::collections::HashMap;
1316
1316
/// let mut map = HashMap::new();
1317
1317
///
1318
1318
/// // Insert 10u with key 2i
@@ -1332,8 +1332,8 @@ impl<K: Eq + Hash<S>, V, S, H: Hasher<S>> HashMap<K, V, H> {
1332
1332
///
1333
1333
/// # Example
1334
1334
///
1335
- /// ```rust
1336
- /// # use std::collections::HashMap;
1335
+ /// ```
1336
+ /// use std::collections::HashMap;
1337
1337
/// let mut map = HashMap::new();
1338
1338
///
1339
1339
/// // Insert 2u with key "a"
@@ -1362,7 +1362,7 @@ impl<K: Eq + Hash<S>, V, S, H: Hasher<S>> HashMap<K, V, H> {
1362
1362
///
1363
1363
/// # Example
1364
1364
///
1365
- /// ```rust
1365
+ /// ```
1366
1366
/// use std::collections::HashMap;
1367
1367
///
1368
1368
/// // map some strings to vectors of strings
@@ -1419,8 +1419,9 @@ impl<K: Eq + Hash<S>, V, S, H: Hasher<S>> HashMap<K, V, H> {
1419
1419
///
1420
1420
/// # Example
1421
1421
///
1422
- /// ```rust
1423
- /// # use std::collections::HashMap;
1422
+ /// ```
1423
+ /// use std::collections::HashMap;
1424
+ ///
1424
1425
/// let mut map = HashMap::new();
1425
1426
/// map.insert("a", 1i);
1426
1427
/// assert_eq!(map.get(&"a"), &1i);
@@ -1437,8 +1438,9 @@ impl<K: Eq + Hash<S>, V, S, H: Hasher<S>> HashMap<K, V, H> {
1437
1438
///
1438
1439
/// # Example
1439
1440
///
1440
- /// ```rust
1441
- /// # use std::collections::HashMap;
1441
+ /// ```
1442
+ /// use std::collections::HashMap;
1443
+ ///
1442
1444
/// let mut map = HashMap::new();
1443
1445
/// map.insert("a", 1i);
1444
1446
/// {
@@ -1489,8 +1491,8 @@ impl<K: Eq + Hash<S>, V, S, H: Hasher<S>> HashMap<K, V, H> {
1489
1491
/// the equivilance class. It is important that the values hash the same,
1490
1492
/// which is why we override `Hash`.
1491
1493
///
1492
- /// ```rust
1493
- /// # use std::collections::HashMap;
1494
+ /// ```
1495
+ /// use std::collections::HashMap;
1494
1496
/// use std::hash::Hash;
1495
1497
/// use std::hash::sip::SipState;
1496
1498
///
@@ -1547,8 +1549,9 @@ impl<K: Eq + Hash<S>, V, S, H: Hasher<S>> HashMap<K, V, H> {
1547
1549
///
1548
1550
/// # Example
1549
1551
///
1550
- /// ```rust
1551
- /// # use std::collections::HashMap;
1552
+ /// ```
1553
+ /// use std::collections::HashMap;
1554
+ ///
1552
1555
/// let mut map = HashMap::new();
1553
1556
/// map.insert("a", 1i);
1554
1557
/// map.insert("b", 2i);
@@ -1567,8 +1570,9 @@ impl<K: Eq + Hash<S>, V, S, H: Hasher<S>> HashMap<K, V, H> {
1567
1570
///
1568
1571
/// # Example
1569
1572
///
1570
- /// ```rust
1571
- /// # use std::collections::HashMap;
1573
+ /// ```
1574
+ /// use std::collections::HashMap;
1575
+ ///
1572
1576
/// let mut map = HashMap::new();
1573
1577
/// map.insert("a", 1i);
1574
1578
/// map.insert("b", 2i);
@@ -1587,8 +1591,9 @@ impl<K: Eq + Hash<S>, V, S, H: Hasher<S>> HashMap<K, V, H> {
1587
1591
///
1588
1592
/// # Example
1589
1593
///
1590
- /// ```rust
1591
- /// # use std::collections::HashMap;
1594
+ /// ```
1595
+ /// use std::collections::HashMap;
1596
+ ///
1592
1597
/// let mut map = HashMap::new();
1593
1598
/// map.insert("a", 1i);
1594
1599
/// map.insert("b", 2i);
@@ -1608,8 +1613,9 @@ impl<K: Eq + Hash<S>, V, S, H: Hasher<S>> HashMap<K, V, H> {
1608
1613
///
1609
1614
/// # Example
1610
1615
///
1611
- /// ```rust
1612
- /// # use std::collections::HashMap;
1616
+ /// ```
1617
+ /// use std::collections::HashMap;
1618
+ ///
1613
1619
/// let mut map = HashMap::new();
1614
1620
/// map.insert("a", 1i);
1615
1621
/// map.insert("b", 2i);
@@ -1634,8 +1640,9 @@ impl<K: Eq + Hash<S>, V, S, H: Hasher<S>> HashMap<K, V, H> {
1634
1640
///
1635
1641
/// # Example
1636
1642
///
1637
- /// ```rust
1638
- /// # use std::collections::HashMap;
1643
+ /// ```
1644
+ /// use std::collections::HashMap;
1645
+ ///
1639
1646
/// let mut map = HashMap::new();
1640
1647
/// map.insert("a", 1i);
1641
1648
/// map.insert("b", 2i);
@@ -1654,8 +1661,9 @@ impl<K: Eq + Hash<S>, V: Clone, S, H: Hasher<S>> HashMap<K, V, H> {
1654
1661
///
1655
1662
/// # Example
1656
1663
///
1657
- /// ```rust
1658
- /// # use std::collections::HashMap;
1664
+ /// ```
1665
+ /// use std::collections::HashMap;
1666
+ ///
1659
1667
/// let mut map: HashMap<uint, String> = HashMap::new();
1660
1668
/// map.insert(1u, "foo".to_string());
1661
1669
/// let s: String = map.find_copy(&1u).unwrap();
@@ -1668,8 +1676,9 @@ impl<K: Eq + Hash<S>, V: Clone, S, H: Hasher<S>> HashMap<K, V, H> {
1668
1676
///
1669
1677
/// # Example
1670
1678
///
1671
- /// ```rust
1672
- /// # use std::collections::HashMap;
1679
+ /// ```
1680
+ /// use std::collections::HashMap;
1681
+ ///
1673
1682
/// let mut map: HashMap<uint, String> = HashMap::new();
1674
1683
/// map.insert(1u, "foo".to_string());
1675
1684
/// let s: String = map.get_copy(&1u);
@@ -1763,7 +1772,7 @@ pub type SetMoveItems<K> =
1763
1772
///
1764
1773
/// # Example
1765
1774
///
1766
- /// ```rust
1775
+ /// ```
1767
1776
/// use std::collections::HashSet;
1768
1777
///
1769
1778
/// // Type inference lets us omit an explicit type signature (which
@@ -1826,7 +1835,6 @@ impl<T: Hash + Eq> HashSet<T, RandomSipHasher> {
1826
1835
///
1827
1836
/// # Example
1828
1837
///
1829
- /// ```rust
1830
1838
/// use std::collections::HashSet;
1831
1839
/// let mut set: HashSet<int> = HashSet::new();
1832
1840
/// ```
@@ -1840,7 +1848,6 @@ impl<T: Hash + Eq> HashSet<T, RandomSipHasher> {
1840
1848
///
1841
1849
/// # Example
1842
1850
///
1843
- /// ```rust
1844
1851
/// use std::collections::HashSet;
1845
1852
/// let mut set: HashSet<int> = HashSet::with_capacity(10);
1846
1853
/// ```
@@ -1898,7 +1905,6 @@ impl<T: Eq + Hash<S>, S, H: Hasher<S>> HashSet<T, H> {
1898
1905
///
1899
1906
/// # Example
1900
1907
///
1901
- /// ```rust
1902
1908
/// use std::collections::HashSet;
1903
1909
/// let mut set: HashSet<int> = HashSet::new();
1904
1910
/// set.reserve(10);
@@ -1957,9 +1963,8 @@ impl<T: Eq + Hash<S>, S, H: Hasher<S>> HashSet<T, H> {
1957
1963
///
1958
1964
/// # Example
1959
1965
///
1960
- /// ```rust
1966
+ /// ```
1961
1967
/// use std::collections::HashSet;
1962
- ///
1963
1968
/// let mut set = HashSet::new();
1964
1969
/// set.insert("a");
1965
1970
/// set.insert("b");
@@ -1979,9 +1984,8 @@ impl<T: Eq + Hash<S>, S, H: Hasher<S>> HashSet<T, H> {
1979
1984
///
1980
1985
/// # Example
1981
1986
///
1982
- /// ```rust
1987
+ /// ```
1983
1988
/// use std::collections::HashSet;
1984
- ///
1985
1989
/// let mut set = HashSet::new();
1986
1990
/// set.insert("a".to_string());
1987
1991
/// set.insert("b".to_string());
@@ -2002,9 +2006,8 @@ impl<T: Eq + Hash<S>, S, H: Hasher<S>> HashSet<T, H> {
2002
2006
///
2003
2007
/// # Example
2004
2008
///
2005
- /// ```rust
2009
+ /// ```
2006
2010
/// use std::collections::HashSet;
2007
- ///
2008
2011
/// let a: HashSet<int> = [1i, 2, 3].iter().map(|&x| x).collect();
2009
2012
/// let b: HashSet<int> = [4i, 2, 3, 4].iter().map(|&x| x).collect();
2010
2013
///
@@ -2032,9 +2035,8 @@ impl<T: Eq + Hash<S>, S, H: Hasher<S>> HashSet<T, H> {
2032
2035
///
2033
2036
/// # Example
2034
2037
///
2035
- /// ```rust
2038
+ /// ```
2036
2039
/// use std::collections::HashSet;
2037
- ///
2038
2040
/// let a: HashSet<int> = [1i, 2, 3].iter().map(|&x| x).collect();
2039
2041
/// let b: HashSet<int> = [4i, 2, 3, 4].iter().map(|&x| x).collect();
2040
2042
///
@@ -2058,9 +2060,8 @@ impl<T: Eq + Hash<S>, S, H: Hasher<S>> HashSet<T, H> {
2058
2060
///
2059
2061
/// # Example
2060
2062
///
2061
- /// ```rust
2063
+ /// ```
2062
2064
/// use std::collections::HashSet;
2063
- ///
2064
2065
/// let a: HashSet<int> = [1i, 2, 3].iter().map(|&x| x).collect();
2065
2066
/// let b: HashSet<int> = [4i, 2, 3, 4].iter().map(|&x| x).collect();
2066
2067
///
@@ -2084,9 +2085,8 @@ impl<T: Eq + Hash<S>, S, H: Hasher<S>> HashSet<T, H> {
2084
2085
///
2085
2086
/// # Example
2086
2087
///
2087
- /// ```rust
2088
+ /// ```
2088
2089
/// use std::collections::HashSet;
2089
- ///
2090
2090
/// let a: HashSet<int> = [1i, 2, 3].iter().map(|&x| x).collect();
2091
2091
/// let b: HashSet<int> = [4i, 2, 3, 4].iter().map(|&x| x).collect();
2092
2092
///
0 commit comments