diff --git a/Sources/BitCollections/BitArray/BitArray+RangeReplaceableCollection.swift b/Sources/BitCollections/BitArray/BitArray+RangeReplaceableCollection.swift index f9374719..34f0d7e1 100644 --- a/Sources/BitCollections/BitArray/BitArray+RangeReplaceableCollection.swift +++ b/Sources/BitCollections/BitArray/BitArray+RangeReplaceableCollection.swift @@ -344,12 +344,12 @@ extension BitArray { /// the `index` parameter, then the new element is appended to the /// collection. /// - /// var bits = [false, true, true, false, true] + /// var bits: BitArray = [false, true, true, false, true] /// bits.insert(true, at: 3) - /// bits.insert(false, at: numbers.endIndex) + /// bits.insert(false, at: bits.endIndex) /// /// print(bits) - /// // Prints "[false, true, true, true, false, true, false]" + /// // Prints "<0101110>" /// /// - Parameter newElement: The new element to insert into the bit array. /// - Parameter i: The position at which to insert the new element. diff --git a/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary.swift b/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary.swift index 73e7921d..9dc157a6 100644 --- a/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary.swift +++ b/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary.swift @@ -329,7 +329,7 @@ extension OrderedDictionary { /// /// hues["Aquamarine"] = nil /// print(hues) - /// // Prints "["Coral": 18, "Heliotrope": 296, "Cerise": 330]" + /// // Prints "["Heliotrope": 296, "Coral": 18, "Cerise": 330]" /// /// - Parameter key: The key to find in the dictionary. /// @@ -601,11 +601,11 @@ extension OrderedDictionary { /// "Heliotrope": 296, /// "Coral": 16, /// "Aquamarine": 156] - /// let newIndex = hues.startIndex + /// let newIndex = hues.elements.startIndex /// let (old, index) = /// hues.updateValue(18, forKey: "Coral", insertingAt: newIndex) /// if let old = old { - /// print("The value '\(old)' at offset \(index.offset) was replaced.") + /// print("The value '\(old)' at offset \(index) was replaced.") /// } /// // Prints "The value '16' at offset 1 was replaced." /// @@ -615,11 +615,11 @@ extension OrderedDictionary { /// let (old, index) = /// hues.updateValue(330, forKey: "Cerise", insertingAt: newIndex) /// if let old = old { - /// print("The value '\(old)' at offset \(index.offset) was replaced.") + /// print("The value '\(old)' at offset \(index) was replaced.") /// } else { - /// print("A new value was inserted at offset \(index.offset).") + /// print("A new value was inserted at offset \(index).") /// } - /// // Prints "A new value was inserted at offset 0.") + /// // Prints "A new value was inserted at offset 0." /// /// - Parameters: /// - value: The new value to add to the dictionary. diff --git a/Sources/SortedCollections/SortedDictionary/SortedDictionary+Subscripts.swift b/Sources/SortedCollections/SortedDictionary/SortedDictionary+Subscripts.swift index b76d3c53..7d50eee6 100644 --- a/Sources/SortedCollections/SortedDictionary/SortedDictionary+Subscripts.swift +++ b/Sources/SortedCollections/SortedDictionary/SortedDictionary+Subscripts.swift @@ -137,7 +137,7 @@ extension SortedDictionary { /// For example, to find the key for a particular value in a sorted dictionary, use /// the `firstIndex(where:)` method. /// - /// let countryCodes: SortedDictionary = ["BR": "Brazil", "GH": "Ghana", "JP": "Japan"] + /// let countryCodes: SortedDictionary = ["BR": "Brazil", "GH": "Ghana", "JP": "Japan"] /// if let index = countryCodes.firstIndex(where: { $0.value == "Japan" }) { /// print(countryCodes[index]) /// print("Japan's country code is '\(countryCodes[index].key)'.")